获取android源码实用脚本

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

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内,耗时在小小时内

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值