AOSP android 源码下载

(1)下载 repo 工具

mkdir ~/bin
PATH=~/bin:$PATH
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
## 如果上述 URL 不可访问,可以用下面的:
## curl -sSL  'https://gerrit-googlesource.proxy.ustclug.org/git-repo/+/master/repo?format=TEXT' |base64 -d > ~/bin/repo
chmod a+x ~/bin/repo

(2)建立工作目录

mkdir WORKING_DIRECTORY
cd WORKING_DIRECTORY

(3)添加 git 用户名

git config --global user.email "[email protected]"
git config --global user.name "Your Name"

(4)初始化仓库

1 repo init -u git://mirrors.ustc.edu.cn/aosp/platform/manifest
2 ## 如果提示无法连接到 gerrit.googlesource.com,可以编辑 ~/bin/repo,把 REPO_URL 一行替换成下面的:
3 ## REPO_URL = 'https://gerrit-googlesource.proxy.ustclug.org/git-repo'

(5)查看库上分支

1 git --git-dir=.repo/manifests/.git/ branch -a

(6)初始化特定分支

repo init -u git://mirrors.ustc.edu.cn/aosp/platform/manifest -b android-8.1.0_r9

(7)下载

repo sync

猜你喜欢

转载自www.cnblogs.com/kele-dad/p/9124559.html