下载repo
#访问不了google,所以从github下载镜像
git clone https:
#我用的是ubuntu15.10,直接用apt-get下载就可以了
sudo apt-get install repo
修改REPO_URL
REPO_URL = 'https://gerrit.googlesource.com/git-repo'
REPO_URL = 'https://gerrit-google.tuna.tsinghua.edu.cn/git-repo'
初始化版本库
mkdir workspace && cd workspace
repo init -u https://android.googlesource.com/platform/manifest
#使用清华大学 AOSP 镜像
repo init -u git://aosp.tuna.tsinghua.edu.cn/aosp/platform/manifest
#如果只需要某个分支
repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest -b android-6.0.1_r9
同步源码树(以后只需执行这条命令来同步):
repo sync
参考