下載 repo 工具
mkdir android7
cd android7
curl https://storage.googleapis.com/git-repo-downloads/repo > repo
chmod a+x repo
注:這樣設置的環(huán)境變量 PATH 是臨時奋构,這樣正好壳影。bin 文件可以建在源碼文件夾的同級目錄下
初始化repo
初始化倉庫:
repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest
如果提示無法連接到 gerrit.googlesource.com弥臼,可以編輯 ~/bin/repo,把 REPO_URL 一行替換成下面的:
REPO_URL = 'https://gerrit-google.tuna.tsinghua.edu.cn/git-repo'
如果需要某個特定的 Android 版本(列表):
repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest -b android-7.1.2_r6
同步源碼樹(以后只需執(zhí)行這條命令來同步):
repo sync