1. 创建bin路径
macbookpro-2d30:~ xxx$ mkdir bin
PATH=~/bin:$PATH
2. 从清华镜像下载repo文件
macbookpro-2d30:bin xxx$ git clone git://aosp.tuna.tsinghua.edu.cn/android/git-repo.git
从git-repo文件下载repo文件拷贝到bin目录
macbookpro-2d30:bin xxx$ cp git-repo/repo ~/bin/
macbookpro-2d30:bin xxx$ chmod a+x repo
3. 打开repo文件,修改REPO_URL为:
macbookpro-2d30:bin xxx$ vim repo
REPO_URL = 'git://aosp.tuna.tsinghua.edu.cn/android/git-repo'
4. 进入自定义的android源码路径:
repo init -u git://aosp.tuna.tsinghua.edu.cn/android/platform/manifest,即可。
5. repo sync -c -j4
清华镜像使用帮助:https://mirrors.tuna.tsinghua.edu.cn/help/#AOSP
中科大镜像使用帮助:https://lug.ustc.edu.cn/wiki/mirrors/help/aosp
Android官方使用帮助:http://source.android.com/source/requirements.html(要翻墙)