安卓源码(二)查看安卓源码分支列表

这里再讲一遍环境安装:
系统deepin 15.4rc

1、安装软件

sudo su
apt-get install openjdk-8-jdk  
apt-get install curl
apt-get install git
git config --global user.email "你的邮箱(随便一个邮箱就行了)"  
git config --global user.name "你的名字"  

2、下载repo与manifests

下载repo

mkdir ~/bin  
PATH=~/bin:$PATH  
curl https://mirrors.tuna.tsinghua.edu.cn/git/git-repo > ~/bin/repo  
chmod a+x ~/bin/repo
nano ~/bin/repo

修改为国内源

将REPO_URL = 'https://gerrit.googlesource.com/git-repo'改为
REPO_URL = 'https://gerrit-google.tuna.tsinghua.edu.cn/git-repo'

添加环境变量

sudo su  
echo export PATH="$PATH:/home/你的用户名/bin" >> /etc/profile
source /etc/profile
exit

下载manifests

新建一个文件夹放,下载完使用 ls -al查看到一个.repo的隐藏文件夹就说明下载完成了
repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest

替换已有的 AOSP 源代码的 remote

如果你之前已经通过某种途径获得了 AOSP 的源码(或者你只是 init 这一步完成后),
 你希望以后通过 TUNA 同步 AOSP 部分的代码,只需要将 .repo/manifest.xml 把其中的 
 https://aosp.tuna.tsinghua.edu.cn/。

<manifest>

   <remote  name="aosp"
-           fetch="https://android.googlesource.com"
+           fetch="https://aosp.tuna.tsinghua.edu.cn"
            review="android-review.googlesource.com" />

   <remote  name="github"
同时,修改 .repo/manifests.git/config,将

url = https://android.googlesource.com/platform/manifest
更改为

url = https://aosp.tuna.tsinghua.edu.cn/platform/manifest
这个方法也可以用来在同步 Cyanogenmod 代码的时候从 TUNA 同步部分代码

3、查看最新安卓分支列表

cd .repo/manifests/
git branch -a

列出的就是全部的安卓源码分支列表了

4、下载安卓特定分支源码

repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest -b android-cts-7.1_r4

5同步源码树

repo sync

参考文章:Android 镜像使用帮助

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值