Ubuntu搭建Android交叉編譯環境

來源:互聯網
上載者:User

標籤:

一、下載 Android NDK

Android NDK官方下載頁:http://developer.android.com/tools/sdk/ndk/index.html

如果需要舊版本的,比如10b版本,64位linux上使用的,可以直接敲 http://dl.google.com/android/ndk/android-ndk32-r10b-linux-x86_64.tar.bz2

>> “ndk32”: 32位target版,想要64位的換成“ndk64”;

>>"r10b": NDK的版本;

>> "linux-x86_64": 64位linux上使用,如果想要32位linux的,換成“linux-x84”; 如果想要64位mac的,換成“darwin-x86_64”。

下載下來之後解壓,然後將ndk-build命令加入到環境變數中

 

1 $nano ~/.bashrc2 #在檔案的末尾加上: export PATH=$PATH:/home/xyj/android-ndk32-r10b3 $source .bashrc

 

  

 二、交叉編譯工具

step1、下載

1 $cd /home/xyj/android-ndk-r10b2 $./build/tools/make-standalone-toolchain.sh --system=linux-x86_64 --toolchain=arm-linux-androideabi-4.83 #斷行符號之後輸入以下內容就是成功了4 Copying prebuilt binaries...  5 Copying sysroot headers and libraries...  6 Copying libstdc++ headers and libraries...  7 Creating package file: /tmp/ndk-xyj/arm-linux-androideabi-4.8.tar.bz2  8 Cleaning up...  9 Done.  

step2、解壓到你想要的路徑$AAA下,將工具鏈加入到環境變數中:

 

$nano ~/.bashrc#在檔案的末尾加上: export PATH=$PATH:$AAA/arm-linux-androideabi-4.8/bin$source .bashrc

 

step3. 檢測是否安裝成功

way1: 

$arm #雙tab

顯示以下內容

way2:

$arm-linux-androideabi-gcc -v #能顯示正確資訊$arm-linux-androideabi-g++ -v #能顯示正確資訊

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.