https://mirrors.tuna.tsinghua.edu.cn/help/#AOSP
1, download the Repo tool, modify the permissions and add to the environment variables.
$git Clone git://aosp.tuna.tsinghua.edu.cn/android/git-repo.git/
$mkdir-P ~/bin
$CP Git-repo/repo ~/bin/
$chmod a+x ~/bin/repo
$vim ~/bin/repo
Modify Repo_url = ' Https://gerrit.googlesource.com/git-repo ' in the REPO file to Repo_url = ' git://aosp.tuna.tsinghua.edu.cn/ Android/git-repo '
$export path=~/bin/: $PATH
2, initialize git, if you need to press branch download, plus-B branch_name can
$repo Init-u Https://aosp.tuna.tsinghua.edu.cn/platform/manifest
3. Repo Sync Sync Code with the following script
Export Path=~/bin: $PATH
Repo Sync-j4
If ["$?"! = "0"]; Then
Sleep 30
Repo Sync-j4
Fi
Attachment 1: For the source code that has been downloaded from Google, you can change the source sync git://from Tsinghua by modifying the. repo/manifest.xml file in the directory. https://android.googlesource.com Aosp.tuna.tsinghua.edu.cn/android/.
Domestic android AOSP Source code download method