Android源碼下載

來源:互聯網
上載者:User

標籤:android   style   http   color   os   使用   for   sp   strong   

Android源碼下載

Linux系統有很多工具和外掛程式,這些外掛程式Linux源生不附帶,需要的話,需要自行下載。官方已經把所有外掛程式部署在Linux的源上,Android源碼的下載,是斷點續傳的,但是臨時檔案很大,至少預備40G空間,當然下載時間也會很長。

> Android源碼下載支援的系統目前只有Ubuntu和Mac OS兩種作業系統, 本次以Ubuntu系統為例。
> 官方網站:http://source.android.com/source/downloading.html

1. 下載Git(版本控制工具).調出命令列: ctrl + alt + T

sudo apt-get install git

2. 安裝curl(上傳和下載資料的工具).

sudo apt-get install curl

3. 安裝repo(一個基於git的版本庫管理工具, 這裡用於自動批量下載android整個項目.).

// 建立目錄
mkdir bin

// 下載repo指令碼到本地bin檔案夾下
curl http://android.git.kernel.org/repo >~/bin/repo
// 如果上面下載失敗, 採用下面這種方式
curl "http://php.webtutor.pl/en/wp-content/uploads/2011/09/repo" >~/bin/repo

// 給所有使用者追加可執行檔許可權
chmod a+x ~/bin/repo

// 臨時把repo添加到環境變數中, 方便後面執行.
// 注意: 每次重啟ubuntu之後此環境變數失效, 重新設定就可以了.
export PATH=~/bin:$PATH

4. 建立檔案夾, 用於存放下載的Android源碼.

// 建立目錄
mkdir android_source

// 修改許可權
chmod 777 android_source

cd android_source

5. 初始化庫.

// 需要先配置git的使用者資訊
git config --global user.email "[email protected]"
git config --global user.name "zhaokan"

repo init -u https://android.googlesource.com/platform/manifest -b android-2.3_r1

// 如果上面初始化失敗, 換下面的試試
repo init -u git://codeaurora.org/platform/manifest.git -b gingerbread
// 或
repo init -u git://android.git.kernel.org/platform/manifest.git -b gingerbread

######當螢幕出現以下資訊表示成功初始化

repo initialized in /home/liyindong/android_source

6. 開始同步下載.

repo sync

**下載過程中, 因為網路問題, 可能會中斷下載. 當中斷下載時, 繼續使用repo sync命令繼續下載.

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.