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 configuration similar operation is possible.
3. Operation Process
1.MAC Open terminal to get the NDK folder 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 detailed path of the file, you can drag it directly to the command terminal form.
3. Continue to run the unzip command
./android-ndk-r10c-darwin-x86_64.bin
At this point in the file storage path will be a complete decompression of the NDK storage folder.
Effects such as:
Get instructions: Unzip the file successfully.
At this point: Open: Command terminal:
Follow these steps, for example:
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 for example to test whether the configuration is successful:
1. cd hello-jni/
2. Running ndk-build
The following interface appears, for example, to indicate that the basic variable is configured successfully:
I will continue in Tutorial II to explain how to configure the steps used in Android studio.
The NDK configuration tutorial for Android Studio under Mac (i)