Ubantu16.04進行Android 8.0源碼編譯

來源:互聯網
上載者:User

標籤:export   特定   http   內容   構建   串連不上   use   提示   err   

分為4個流程

  1. 源碼下載
  2. 構建編譯環境
  3. 編譯源碼
  4. 運行
源碼下載安裝git並且配置
//安裝gitsudo apt-get install git//配置git名稱和郵箱git config --global user.name "your name"git config --global user.email "[email protected]"
建立repo的bin目錄和源碼目錄
  1. 建立repo的bin目錄

    midir ~/bin
  2. 建立源碼目錄

    midir ~/source
安裝repo

由於在採用網上常見的安裝repo方法時,出現了Cannot get http://gerrit.googlesource.com/git-repo/clone.bundle異常,通過網上搜尋,原因是repo需要更新自身項目時,串連不上項目本身的git倉庫,在此,採取了手動拉取repo最新項目的方式

  1. 從git上拉取repo項目

    git clone https://gerrit-googlesource.lug.ustc.edu.cn/git-repo
  2. git-repo裡面的repo檔案複製到~/bin目錄

  3. ~/source目錄建立.repo檔案夾,把git-repo重新命名為repo複製到.repo目錄下

  4. ~/bin/repo 添加到環境變數,並賦予許可權

    //賦予許可權chmod a+x ~/bin/repo//添加到環境變數將export REPO=~/bin 添加到~/.bash_profile///讓設定檔生效source ~/.bash_profile
下載源碼初始化倉庫

cd到~/source目錄,執行以下命令

repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest

或者這個命令

repo init -u git://aosp.tuna.tsinghua.edu.cn/aosp/platform/manifest

兩者實現的效果一致,僅僅只是協議不同.
如果執行該命令的過程中,如果提示無法串連到 gerrit.googlesource.com,那麼我們只需要編輯 ~/bin/repo檔案,找到REPO_URL這一行,然後將其內容修改為:

REPO_URL = ‘https://gerrit-google.tuna.tsinghua.edu.cn/git-repo‘
然後重新執行上述命令即可.

補充說明
不帶參數的manifest命令用於擷取master上最新的代碼,但是可以通過-b參數指定擷取某個特定的android版本,比如我們想要擷取android-4.0.1_r1分支,那麼命令如下:

repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest -b android-4.0.1_r1
(AOSP項目當前所有的分支列表參看:分支列表)

同步代碼

命令如下

repo sync

Ubantu16.04進行Android 8.0源碼編譯

聯繫我們

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