1、mkdir ~/bin
PATH=~/bin:$PATH
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
2、vim ~/.bashrc
增加export REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/'
vim ~/bin/repo
替换
REPO_URL = ‘https://gerrit-google.tuna.tsinghua.edu.cn/git-repo’
3、repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest -b android-9.0.0_r3 --depth=1 拉去指定的android-9.0.0_r3版本,不要拉 Fetch日志
4、repo sync -j8 -c,-current-branch --no-tags ,启用8个线程操作,获取当前新分支,不要tags信息
大小在20G内,耗时在小小时内

本文介绍了如何设置Android源码下载的优化方案,包括在用户目录创建bin文件夹,更新PATH变量,通过curl下载repo并赋予执行权限。接着修改.bashrc文件以指定Tsinghua University的repo镜像源,并在repo脚本中替换URL。最后,展示了使用repo init和repo sync命令从特定镜像源拉取Android 9.0.0_r3版本,以及同步时的参数设置,如启用8个线程,不获取tags信息,以实现高效下载。
1006

被折叠的 条评论
为什么被折叠?



