簡記Ubuntu下載 Android源碼

來源:互聯網
上載者:User

標籤:下載   google   name   環境   man   font   nbsp   aosp   repo   

1.下載Ubuntu系統,推薦16.04以上版本;

2. git : 使用repo工具的時候會用到git,要預先安裝git,使用命令:sudo apt-get install git 

3. 安裝git後,對git進行配置,設定git電子郵件和使用者名稱

  (1) git config --global user.email "你的電子郵件" 

  (2) git config --global user.name "你的名字"

4. 安裝curl (開源檔案傳輸工具) , 使用命令: sudo apt-get install curl -y

5. 重要環節 : 下載repo

下載repo之後,將repo的路徑設為環境變數,並且將許可權改成可執行
mkdir ~/bin
PATH=~/bin:$PATH
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo

6. 接下來建立一個目錄,用於放置Android源碼,並進入該目錄如下:

   (1) mkdir android

   (2) cd android

7. 使用repo初始化

repo init -u git://mirrors.ustc.edu.cn/aosp/platform/manifest

如果提示無法串連到 gerrit.googlesource.com,可以編輯 ~/bin/repo,把 REPO_URL 一行替換成:

REPO_URL = ‘https://mirrors.tuna.tsinghua.edu.cn/git/git-repo‘

如果你只想下載特定的android版本,可以使用如下命令:

repo init -u git://mirrors.ustc.edu.cn/aosp/platform/manifest -b  Android版本 (比如:android-7.1.1_r13)

8. 下載代碼,命令如下 (註:這個過程很耗時間)

repo sync  

簡記Ubuntu下載 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.