使用repo下载Android源码(无需翻墙)
2016-11-19 15:17
435 查看
一、安装git和curl
git: sudo apt-get install git-corecurl: sudo apt-get install git-core curl
二、下载repo
1、进入bin目录: cd /bin2、下载repo: curl https://storage.googleapis.com/git-repo-downloads/repo > ./repo
3、为repo增加可执行权限: chmod a+x repo
注:
如果上述 URL 不可访问,可以使用下面的:curl https://storage-googleapis.lug.ustc.edu.cn/git -repo-downloads/repo > ./repo
三、下载Android源码
1、进入一个内存大一点的磁盘2、mkdir Android
3、cd Android
4、初始化仓库: repo init -u git://mirrors.ustc.edu.cn/aosp/platform/manifest -b android-2.3.1_r1
其中mirrors.ustc.edu.cn是中国科技技术大学的镜像源;android-2.3.1_r1是对应Android版本的分支
通过测试,repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest -b android-2.3.1_r1似乎更快。
5、同步源码: repo sync
注:
1、第一次同步时需要初始化github账号,可在github官网注册,然后在终端进行配置:git config –global user.email “github邮箱”
git config –global user.name “github用户名”
2、在同步时,任务会经常中断,可以写个shell脚本,就不需要一直等着了
(1)vim download.sh
加入以下内容:
#!/bin/bash echo "======start repo sync======" repo sync while [ $? == 1 ]; do echo "======sync failed, re-sync again======" sleep 3 repo sync done
(2)chmod a+x download.sh 增加可执行权限
(3)./download.sh 开始运行
网速好点的话,等几个小时,源码就可以下载好了!如下图 ↓↓↓
相关文章推荐
- Android源码下载 ---- git 和 repo 使用
- 编译Android源码(1) ---- 使用repo下载源代码
- repo 使用goagent 代码下载android源码
- 使用repo和git下载android源码 和 相关解释
- 国内镜像 android源码下载,无需翻墙
- Android系统源码编译之3---下载 ---- git 和 repo 使用
- 如何使用repo下载部分Android源码并保持项目结构
- GIT和repo使用方法:下载内核 android源码包
- 【Android源码编译】使用repo工具下载获取android源码
- 使用git下载android源码 Git和Repo扫盲——如何取得Android源代码
- 使用repo和git下载android源码 和 相关解释
- 使用repo和git下载android源码 和 相关解释
- 64位ubuntu11.10使用git下载android源码
- GIT和repo使用方法,下载android-2.6.29内核
- 用repo下载android源码时出错
- 使用git下载android源码(zz)
- 使用repo方式下载android代码
- Windows下使用msysgit下载Android源码
- Android 使用git下载源码报错解决方法