一、下载android 源码
1.下载 repo(需已安装git)
repo 是Google开发的一个脚本文件,用来简化Git下载安卓源码的过程。
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
$ PATH=~/bin:$PATH

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

4.同步源码
还是和以前一样
$ repo sync -j8

5.替换已有的AOSP源代码的remote
如果之前已经通过某种途径获得了AOSP的源码,但是你希望以后通过TUNA同步,只需要将.repo/manifest.xml中的
<remote name="aosp"
fetch=".."
review="https://android-review.googlesource.com/" />
改为下面的code即可:
<remote name="aosp"
fetch="git://aosp.tuna.tsinghua.edu.cn/android/"
review="https://android-review.googlesource.com/" />

这个方法也可以用来在同步Cyanogenmod代码的时候从TUNA同步部分代码




更多相关文章

  1. android studio 教你修改Maven仓库地址为国内镜像
  2. android studio基础知识2 -- 设置代理,轻松下载sdk
  3. Android(安卓)开源项目分类汇总(很全)
  4. Android(安卓)调用摄像头拍照 以及 从相册中选择照片
  5. 高德地图-根据经纬度获取地址(逆地理编码)
  6. Android中无法访问本地Apache服务器原因
  7. Binder驱动之内存映射----binder_mmap
  8. Android(安卓)获取Ip
  9. Failed to fetch url https //dl.google.com/android/repository

随机推荐

  1. Binder---- Android(安卓)的IPC 通信机制
  2. Android阶段性总结(2011/9/6)
  3. Android(安卓)Handler 异步消息处理机制
  4. Android(安卓)是什么
  5. Android(安卓)中的微型云
  6. Android自动化测试之Monkey工具
  7. android apk的反编译
  8. android之wifi开发(一)
  9. Android(安卓)之6.0 双向通话自动录音
  10. android 文件系统分析