首页 > 移动平台 > 详细

利用国内镜像下载Android源码

时间:2016-07-07 12:45:47      阅读:174      评论:0      收藏:0      [点我收藏+]
为了编译安卓源码,首先需要一个Linux,本次采用Ubuntu Kylin14.04,内核版本3.13。装在四核、4G内存、120G硬盘的虚拟机上(光源码60G,所以一定要多些硬盘)。虚拟机安装较为简单,不再整理。 
查看内核版本号:
$uname -all
清华镜像地址
清华镜像站的速度还是比较快的,地址:
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 安卓源码版本号即可。
$ repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest -b android-4.0.1_r1
同步源码 
$repo sync [-j4]
后面-j4表示4个线程进行下载,清华镜像允许最多4线程下载,不要超过4个。
如果中间发现断掉了或者报错了,不要紧张,重新运行一下。源码大小

利用国内镜像下载Android源码

原文:http://www.cnblogs.com/wxishang1991/p/5649517.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!