Because the domestic network is the wall reason, according to Google provides the way to download the Android source code is difficult to download, so write down this article.
1. Download and configure repo information
mkdir ~/binpath=~/bin: $PATHgit clone Git://aosp.tuna.tsinghua.edu.cn/android/git-repo.git
2. Copy the repo file from the Git-repo in the step to the bin directory
CP Git-repo/repo ~/bin/
3. Modify the Repo file
sudo vim ~/bin/reporepo_url = ' Git://aosp.tuna.tsinghua.edu.cn/android/git-repo '
4. Ready to download Android source code
mkdir anroidcd androidgit config--global user.email "[email protected]" git config--global user.name "Your name" Repo Init -U git://aosp.tuna.tsinghua.edu.cn/android/platform/manifest-b android-5.0.2_r1
Note: View Source branch: Http://source.android.com/source/build-numbers.html#source-code-tags-and-builds
5. Download the source code formally
Repo Sync script (build script in Source directory: VI down.sh):
#!/bin/sh
Repo sync-j16
While [$?-ne 0]
Do
Repo sync-j16
Done
Execute download command: SH down.sh
Android Source Download 2