標籤:android 原始碼 網路 branch 伺服器
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.如何搭建本地倉庫方便周圍的人一塊使用
在從伺服器擷取代碼建立本地倉庫
(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
連絡方式:
[email protected]
QQ:390012381
轉載請註明出處:http://blog.csdn.net/lihui130135
Android L下載