Android教程網
  1. 首頁
  2. Android 技術
  3. Android 手機
  4. Android 系統教程
  5. Android 游戲
 Android教程網 >> Android技術 >> Android編程入門 >> Ubuntu下下載Google Android4.4源碼

Ubuntu下下載Google Android4.4源碼

編輯:Android編程入門

【Linux/Ubuntu學習6】unbuntu 下載android源碼

在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

  1. 上一頁:
  2. 下一頁:
熱門文章
閱讀排行版
Copyright © Android教程網 All Rights Reserved