android源碼下載

android源碼下載成功記錄

1.安裝git

sudo apt-get install git-core

2.安裝curl

sudo apt-get install git-core curl

3.安裝repo, 通過curl下載repo

網上或者很多書籍上都是這樣寫的:

curl http://android.git.kernel.org/repo > ~/bin/repo

結果得到的repo不能用,什麼301重定向的,唉!悲催啊!後來在csdn上發了個貼子,大牛給解決啦!

http://code.google.com/p/git-repo/downloads/detail?name=repo-1.12 這個鏈接提供下載repo!

也可以通過下面命令得到:

curl http://git-repo.googlecode.com/files/repo-1.12 > ~/bin/repo

4.修改執行權限

chmod a+x ~/bin/repo

5.修改~/bin/repo文件將第五行

這一步又是容易出錯啊,哥就死在這裏很久啊!很多書籍或網站上都是這樣命令:

~/bin/repo init -u git://android.git.kernel.org/platform/manifest.git

執行以後,等n久,結果出現讓你喜出望外的結果啊

error:Failed connect to code.google.com:443; Operation now in progress while accessing https://code.google.com/p/git-repo//info/refs

網上大牛解決:修改~/bin/repo文件將第五行

REPO_URL='https://code.google.com/p/git-repo/'

改爲

REPO_URL='http://code.google.com/p/git-repo/'

6.然後向PATH中添加bin路徑:

export PATH=$PATH:~/bin

7.新建一個目錄,然後進入該目錄。

mkdir source

cd source

8:執行

repo init –u git://android.git.kernel.org/platform/manifest.git的時候報鏈接被拒絕,所以換了個源來下載
repo init -u git://codeaurora.org/platform/manifest.git -b gingerbread
這中間會問到你的名字和Email。如果你打算上傳代碼,Email須是一個Google賬戶。 repo初始化成功後會看到類似於下面的提 示: repo initialized in /home/(當前用戶名)/source
9:
最後執行$repo sync開始同步代碼。過程比較漫長,下載速度取決於你的網速(偶的3-4小時左右),中間有可能遇到斷線,重新執行repo sync即可斷點續傳。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章