Android 6編譯環境搭建 (Marshmallow)

來源:互聯網
上載者:User

標籤:

1.安裝 ubuntu 14.03 

       儘管android推薦 ubuntu 15, 安全起見,還是裝LTS的14.04,步驟跳過

2. JDK:

Marshmallow 需要 JDK8 ,添個源,順手配下java

sudo add-apt-repository ppa:openjdk-r/ppasudo apt-get update sudo update-alternatives --config java
sudo update-alternatives --config javac

 

3.裝下依賴項

sudo apt-get install git-core gnupg flex bison gperf build-essential   zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386   lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache   libgl1-mesa-dev libxml2-utils xsltproc unzip

4. adb USB 

 wget -S -O - http://source.android.com/source/51-android.rules | sed "s/<username>/$USER/" | sudo tee >/dev/null /etc/udev/rules.d/51-android.rules; sudo udevadm control --reload-rules

5.設定編譯輸出目錄

 

export OUT_DIR_COMMON_BASE=<path-to-your-out-directory>

6.裝個REPO工具$ mkdir ~/bin


牆外
mkdir ~/bin
PATH=~/bin:$PATH
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
 
牆內

cd ~
git clone git://aosp.tuna.tsinghua.edu.cn/android/git-repo.git

PATH=~/git-repo:$PATH

7.建個工作目錄

mkdir ~/marshmallow
cd ~/marshmallow
牆內


指定Head版本
repo init -u git://aosp.tuna.tsinghua.edu.cn/aosp/platform/manifest
指定分支
repo init -u git://aosp.tuna.tsinghua.edu.cn/aosp/platform/manifest -b android-6.0.1_r16
 
牆外
repo init -u https://android.googlesource.com/platform/manifest
或者

repo init -u https://android.googlesource.com/platform/manifest -b android-6.0.1_r16
 
同步代碼
$ repo sync


 

8.

Android 6編譯環境搭建 (Marshmallow)

聯繫我們

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