6

I am following Google's documentation on how to download the source code for Android. But my ISP is very slow and I have been downloading things for 5 days now.

I have noticed it downloads support for many devices that I don't want like LG nexus etc. Is there a way to download just the core source code and support for Nexus 7 (2013, flo) easily?

alcarv
  • 889
  • 6
  • 15
  • 1
    I'd have to agree this is poorly managed. You can see the instructions for creating a local manifest override, however it is not trivial to decide which repositories that should contain/exclude for a particular goal (beyond obvious ones like only getting either the Linux or OSX prebuilt tools, not both). Also, you have an option to repo to tell git to pull down only a given branch and not all the history, which will make things substantially smaller. – Chris Stratton Apr 13 '15 at 00:24
  • I thought about creating a manifest, but I wouldn't know what to get, really. I am already using `-b android-4.4.4_r1`, is that what you say about only fetching one branch? I have already over 30G of code and it's currently downloading one package of 11G (platform/external/stressapptest). – alcarv Apr 13 '15 at 00:34
  • You could use `--depth=1` with `repo init` to create a shallow copy, but you will not be able to push changes. Also a later `repo sync` may re-download everything. – Mathias Apr 13 '15 at 12:35

1 Answers1

3

It seems the preferred way to do it is by using groups in defined in the manifest. That's available with repo's -g option, as I found here.

Like this example, for working with on ARM system image from the emulator:

repo init -u ... -g all,-notdefault,-device,-mips,-x86,-darwin

I guess in my case I would use:

repo init -u https://android.googlesource.com/platform/manifest -b android-4.4.4_r1 \
  -g all,-notdefault,-linux,-mips,-x86,-device,flo

Meaning I will download all groups excluding notdefault, linux pre-built tools, mips and x86 buildng architectures and all devices. But then I add just the flo device which is my Nexus 7.

Another usefull option I found in repo is the -c when syncing which will fetch only the current branch from server:

repo sync -c
alcarv
  • 889
  • 6
  • 15