Android L下载

Android L千呼万唤最终出来了,那么我们先下载下来一睹为快,那么怎么去拿到最新的L的分支
那依照傻瓜步骤总结下(Linux Ubuntu)
1.获取repo文件
(1).curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
(2).chmod a+x ~/bin/repo
(3).export PATH=~/bin:$PATH



curl 是linux以下用命令发起网络请求的工具,拿到repo文件找到位置直接增加到系统PATH中


2.利用repo获取获取源码
(1).mkdir src && cd src
(2).repo init -u https://android.googlesource.com/platform/manifest
(3).repo sync

上面代码获取的是master代码


假设想单独获取某个分支的代码
(1).mkdir src && cd src
(2).repo init -u https://android.googlesource.com/platform/manifest -b android-5.0.0_r2
(3).repo sync



假设已经有android仓库可是还不是最新的,想切换到AndroidL分支分支
(1).cd .repo/manfiests && git branch -a | cut -d / -f 3
android-4.4.4_r2.0.1
android-4.4_r1
android-4.4_r1.0.1
android-4.4_r1.1
android-4.4_r1.1.0.1
android-4.4_r1.2
android-4.4_r1.2.0.1
android-4.4w_r1
android-5.0.0_r1
android-5.0.0_r2

(2).依据上面列表的选取android-5.0.0_r2 
repo init -b android-5.0.0_r2
(3). repo sync
(4).所有切换到android-5.0.0_r2分支
repo start android-5.0.0_r2 --all
(5). repo branches
*  android-5.0.0_r2          | in all projects
(6).cd external/jsmn && git branch
* android-5.0.0_r2


3.怎样搭建本地仓库方便周围的人一块使用
在从server获代替码创建本地仓库
(1).mkdir -p ~/aosp/mirror
(2).cd ~/aosp/mirror
(3).repo init -u https://android.googlesource.com/mirror/manifest --mirror
(4).repo sync



从本地mirror获代替码
(1). mkdir -p ~/aosp/master
(2). cd ~/aosp/master
(3). repo init -u /home/username/aosp/mirror/platform/manifest.git
(4). repo sync



同步本地mirror以及本地代码仓库
(1).cd ~/aosp/mirror
(2).repo sync
(3).cd ~/aosp/master
(4).repo sync




联系方式:
lihui40319@sina.com
QQ:390012381
转载请注明出处:http://blog.csdn.net/lihui130135
原文地址:https://www.cnblogs.com/mengfanrong/p/4266906.html