Ubuntu builds Android cross-compilation environment

Source: Internet
Author: User

First, download the Android NDK

Android NDK Official download page:http://developer.android.com/tools/sdk/ndk/index.html

If you need an older version, such as the 10b version, 64-bit Linux, you can directly knock http://dl.google.com/android/ndk/android-ndk32-r10b-linux-x86_64.tar.bz2

>> "Ndk32": 32-bit target version, want 64-bit replaced by "ndk64";

>> "r10b": Version of NDK;

>> "linux-x86_64": Used on 64-bit Linux, if you want 32-bit Linux, replace it with "linux-x84"; If you want a 64-bit Mac, replace it with "darwin-x86_64".

Download it and unzip it, then add the ndk-build command to the environment variable

1 $nano ~/bashrc2 #在文件的末尾加上: Export path= $PATH:/home/xyj/android-ndk32-r10b 3 $source. BASHRC

  

Second, cross-compiling tools

Step1, download

1$CD/HOME/XYJ/ANDROID-NDK-r10b 2$./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 ...  6Copying libstdc++headers and Libraries   ...7Creating Package File:/tmp/ndk-xyj/arm-linux-androideabi-4.8  . tar.bz2 8  Cleaning up ... 9Done.

Step2, unzip to the path $aaa you want, and add the toolchain to the environment variable:

$nano ~/. bashrc# at the end of the file add: Export PATH= $PATH: $AAA/arm-linux-androideabi-4.8/Bin$source. BASHRC

Step3. Detect if the installation was successful

Way1:

$arm #双tab

Show the following:

Way2:

$arm-linux-androideabi-gcc-v #能显示正确信息 $arm-linux-androideabi-g++-v #能显示正确信息

Ubuntu builds Android cross-compilation environment

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.