下载android 源码
16lz
2021-01-26
一、下载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.下载 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同步部分代码
更多相关文章
- android studio 教你修改Maven仓库地址为国内镜像
- android studio基础知识2 -- 设置代理,轻松下载sdk
- Android(安卓)开源项目分类汇总(很全)
- Android(安卓)调用摄像头拍照 以及 从相册中选择照片
- 高德地图-根据经纬度获取地址(逆地理编码)
- Android中无法访问本地Apache服务器原因
- Binder驱动之内存映射----binder_mmap
- Android(安卓)获取Ip
- Failed to fetch url https //dl.google.com/android/repository