unbuntu 下載android源碼

來源:互聯網
上載者:User

標籤:android   http   ar   os   使用   sp   for   檔案   on   

在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://www.linuxidc.com/Linux/2014-08/105310.htm

Android 4.4.4 發布下載 http://www.linuxidc.com/Linux/2014-06/103467.htm

最簡單的Ubuntu Touch & Android 雙系統安裝方式 http://www.linuxidc.com/Linux/2014-01/94881.htm

在Nexus上實現Ubuntu和Android 4.4.2 雙啟動 http://www.linuxidc.com/Linux/2014-05/101849.htm

Ubuntu 14.04 配置 Android SDK 開發環境 http://www.linuxidc.com/Linux/2014-05/101039.htm

64位Ubuntu 11.10下Android開發環境的搭建(JDK+Eclipse+ADT+Android SDK詳細) http://www.linuxidc.com/Linux/2013-06/85303.htm

Ubuntu 14.04 x64配置Android 4.4 kitkat編譯環境的方法 http://www.linuxidc.com/Linux/2014-04/101148.htm

Ubuntu 12.10 x64 安裝 Android SDK http://www.linuxidc.com/Linux/2013-03/82005.htm

更多Ubuntu相關資訊見Ubuntu 專題頁面 http://www.linuxidc.com/topicnews.aspx?tid=2

更多Android相關資訊見Android 專題頁面 http://www.linuxidc.com/topicnews.aspx?tid=11

本文永久更新連結地址:http://www.linuxidc.com/Linux/2014-08/105323.htm

unbuntu 下載android源碼

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.