The NDK configuration tutorial for Android Studio under Mac (i) 1. Overview
最近项目全线转移到Mac下使用使用Android studio开发。遇到关键代码封装到 ***native***层,此时在win下的NDK配置步骤全部失效。 为此,花费了大量时间用来查阅资料,在此,记录下来,分享给大家供以后配置中作为参考。
2. Environment
The development configuration I use is: MAC OS 10.10 +androioid Studio 1.2+android-ndk-r10e-darwin-x86_64+git. Other configurations are similar.
3. Operation Process
1.MAC Open terminal to get the NDK directory permissions
chmod a+x Android-ndk-r10c-darwin-x86_64.bin
The path behind the file is stored.
2.CD path.
CD path.
If you do not know the exact path of the file, you can simply drag it to the Command Terminal window.
3. Continue with the decompression command
./android-ndk-r10c-darwin-x86_64.bin
At this point in the file storage path will be a decompression after the completion of the NDK storage directory.
Effects such as:
Get instructions: Unzip the file successfully.
At this point: Open: Command terminal:
To do this, follow these steps:
1. Enter the command pico .bash_profile
2. export NDK_ROOT=/Applications/Android-NDK/android-ndk-r10e
3. export PATH=$PATH:$NDK_ROOT
Last Save (control+x) Select Y
4. Update the newly configured environment variable inputsource .bash_profile
Validation successful
1. Enter under Terminal
Under the NDK under the sample folder
Follow the steps below to test whether the configuration was successful:
1. cd hello-jni/
2. Implementation ndk-build
The following interface appears to indicate the success of the basic variable configuration:
I will continue in Tutorial II to explain how to configure the steps used in Android studio.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
The NDK configuration tutorial for Android Studio under Mac