国内下载android源码镜像地址及方法

清华的git在2016年6月24停用了,只支持https的方式,未试,详细可以看他们的说明


最下方补充中科大的地址,目前可用,源码更新至7.1.0_r4(2016年11月8日)


清华镜像地址:git://aosp.tuna.tsinghua.edu.cn/android/

说明地址:http://aosp.tuna.tsinghua.edu.cn/android/


下载 repo 
$git clone git://aosp.tuna.tsinghua.edu.cn/Android/git-repo.git/


修改repo 
$vi /git-repo.git/repo 
google的地址 
REPO_URL = ‘https://gerrit.googlesource.com/git-repo’ 
改为清华大学的地址 
REPO_URL = ‘git://aosp.tuna.tsinghua.edu.cn/android/git-repo’

下载 manifest 
google 的地址 
$ repo init -u https://android.googlesource.com/platform/manifest 
改为清华大学的地址 
$ repo init -u git://aosp.tuna.tsinghua.edu.cn/android/platform/manifest 
如果需要设置版本,加入参数-b +安卓源码版本号即可,没有则下载最新版本的源码。


如何查看源码版本号:

/build/core/version_defaults.mk

查找PLATFORM_VERSION即可。



下载时出现:repo sync error:Exited sync due to fetch errors

$repo sync -f -j4

-f  or  --force-broken flag allows it to recover from network error and more important recover on broken/missng objects

-jN use N threads   清华最大支持4线程下载



补充中科大镜像


curl https://storage-googleapis.lug.ustc.edu.cn/git-repo-downloads/repo  > ~/bin/repo #从中科大镜像源下载repo工具
chmod a+x ~/bin/repo #更改可执行权限
mkdir ~/android #创建目录存放源码 文件名随便
cd ~/android #转到目录
repo init -u git://mirrors.ustc.edu.cn/aosp/platform/manifest
#如果提示无法连接到 gerrit.googlesource.com,执行 vi ~/bin/repo  把 REPO_URL 一行替换成下面的:REPO_URL = 'https://gerrit-googlesource.lug.ustc.edu.cn/git-repo'
repo sync

  • 7
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值