When we download Android source code, we use “repo sync” command. It takes long time. I show you the tips about “repo sync” to save time.
Reducing amount of download size by copying the existing repository
If you have already downloaded old source code (for example, android-2.2_r1.1), you can reduce amount of newly download size to use old repository. so you download only the difference.
$ mkdir android-2.3 $ cd android-2.3/ $ repo init -u git://android.git.kernel.org/platform/manifest.git -b android-2.3.4_r1 $ cp -R ../android-2.2_r1.1/.repo/projects .repo/ $ repo sync
If you can overwrite the existing working directory,
$ mv android-2.2_r1.1 android-2.3 $ cd android-2.3 $ repo init -b android-2.3.4_r1 $ repo sync
Option to run repo sync parallely
“make” command has ‘-j’ option to run multi jobs parallely. “repo sync” has similar option, too.
Let’s examine command line help.
$ repo sync -h Usage: repo sync [...] Options: -h, --help show this help message and exit -f, --force-broken continue sync even if a project fails to sync -l, --local-only only update working tree, don't fetch -n, --network-only fetch only, don't update working tree -d, --detach detach projects back to manifest revision -q, --quiet be more quiet -j JOBS, --jobs=JOBS number of projects to fetch simultaneously -s, --smart-sync smart sync using manifest from a known good build repo Version options: --no-repo-verify do not verify repo source code $
If you want to run 4 fetching jobs pararellely,
$ repo sync -j4
This can reduce the download time. However, be sure not to occupy the bandwidth of the network.