在Ubuntu上下載Google Android4.4源碼,ubuntuandroid4.4
在Windows下安裝Cygwin,通過Cygwin也可在Windows裡通過本文的下載步驟下載Android源碼。
以下為在Ubuntu下下載Google Android4.4源碼的步驟:
1. 安裝curl 與 git
sudo apt-get install curl
sudo apt-get install git-core
2 安裝 Repo
a) 建立Repo的安裝目錄、配置環境變數
$ mkdir ~/bin
$ PATH=~/bin:$PATH
b) 擷取Repo工具
$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
問題:上面是Google制定的repo擷取地址,但擷取可能失敗。
解決辦法:網上有網友給出了替代的擷取地址,如遇報錯可用下面的地址替代:
curl "http://php.webtutor.pl/en/wp-content/uploads/2011/09/repo" > ~/bin/repo (我是使用這個,可用)
然後改變許可權:
$ chmod a+x ~/bin/repo
3 建立並進入源碼下載目錄
$ mkdir WORKING_DIRECTORY
$ cd WORKING_DIRECTORY
4 初始化源碼Repo
如是下載當前最新的代碼,則:
repo init -u https://android.googlesource.com/platform/manifest
如是下載特定Android成熟版本分支的代碼,則加上-b 參數,如當前最新發行的android 4.4分支代碼:
repo init -u https://android.googlesource.com/platform/manifest -b android-4.4.1_r1
命令如順利執行,期間將要求輸入unsername和email,直接輸入自己的自訂的使用者名稱和email即可。
5 同步全套原始碼
$ repo sync
問題:命令執行過程中可能會報錯:
fatal: '../platform/abi/cpp.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
error: Cannot fetch platform/abi/cpp
解決辦法:
進入WORKING_DIRECTORY,顯示隱藏檔案,可看到.repo目錄並開啟manifest.xml裡,找到fetch屬性,並修改為:
fetch= "git://Android.git.linaro.org
repo sync命令在執行過程中一般不會一次性成功,中途可能逾時或存在其他失敗,此時只需再次執行repo sync即可,以前的記錄會被緩衝的。
參考文檔:http://blog.csdn.net/droidpioneer/article/details/24738353
ubuntu上下載android源碼
請明示你的安卓源碼是什麼目的的,虛擬機器是跑在Windows上運行Ubuntu嗎?
建議乾乾淨淨的玩開源,不喜歡虛擬機器
怎下載android42原始碼
之前在ubuntu下下載過源碼,比較麻煩的一項工程。網上找個文檔吧,當時我也是在網上看的。