国内镜像下载Android源码

转自: http://m.blog.csdn.net/blog/xm379303813/45126101

编译环境

为了编译安卓源码,首先需要一个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/

下载

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

  2. 修改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’

  3. 下载 manifest 
    google 的地址 
    $ repo init -u https://android.googlesource.com/platform/manifest 
    改为清华大学的地址 
    $ repo init -u git://aosp.tuna.tsinghua.edu.cn/android/platform/manifest 
    如果需要设置版本,加入参数-b 安卓源码版本号即可。
  4. 同步源码 
    $repo sync [-j4] 
    后面-j4表示4个线程进行下载,清华镜像允许最多4线程下载,不要超过4个。 
    如果中间发现断掉了或者报错了,不要紧张,重新运行一下。源码大小

猜你喜欢

转载自blog.csdn.net/konga/article/details/49970577