通過清華TUNA鏡像源下載Android源碼
阿新 • • 發佈:2019-01-09
con config help pla .bashrc bash 修改權限 mir man 建議參考官方教程:https://mirrors.tuna.tsinghua.edu.cn/help/AOSP/
以下為自己測試時執行的步驟:
1、下載repo
$ curl https://mirrors.tuna.tsinghua.edu.cn/git/git-repo -o repo
2、修改權限並拷貝到 PATH 中
$ chmod a+x repo
$ sudo mv repo /usr/bin/
3、使用tuna鏡像源更新(需重啟模擬終端)
$ vi ~/.bashrc
export REPO_URL=‘https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/‘
4、初始化倉庫
$ repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest
a.過程中如遇到Git錯誤,設置git config即可
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
b.如果需要指定Android版本
$ repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest -b android版本
5、同步源碼(代碼比較大,耗時比較久)
$ repo sync
通過清華TUNA鏡像源下載Android源碼