在Ubuntu上下載Google Android4.4源碼,ubuntuandroid4.4

來源:互聯網
上載者:User

在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下下載過源碼,比較麻煩的一項工程。網上找個文檔吧,當時我也是在網上看的。
 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.