Android studio NDK configuration tutorial on Mac (1), androidndk
Tutorial on NDK configuration of Android studio on Mac (1) 1. Overview
Recently, the entire project has been transferred to Mac for Android studio development. When key code is encapsulated in the ** native ** layer, all NDK configuration steps under win fail. For this reason, it takes a lot of time to view the information. Here, we will record it and share it with you for reference in future configuration.
2. Environment
I am using the development configuration is: mac OS 10.10 + androioid studio 1.2 + android-ndk-r10e-darwin-x86_64 + git. Other configurations are similar.
3. Procedure
1. Open the terminal in MAC to obtain the NDK directory permission
Chmod a + x android-ndk-r10c-darwin-x86_64.bin
It is followed by the file storage path.
2. cd path.
Cd path.
If you do not know the specific path of the file, you can drag it to the command terminal window.
3. Continue to execute the decompression command
/Android-ndk-r10c-darwin-x86_64.bin
In this case, an NDK directory is obtained in the file storage path after decompression.
The effect is as follows:
Note: The file is successfully decompressed.
At this point: open: Command terminal:
Follow these steps:
1. Enter the commandpico .bash_profile
2.export NDK_ROOT=/Applications/Android-NDK/android-ndk-r10e
3.export PATH=$PATH:$NDK_ROOT
Save (control + X) and select Y
4. Update the environment variable input.source .bash_profile
Verification Successful
1. Enter the terminal
Under the sample folder under NDK
To test whether the configuration is successful, follow these steps:
1.cd hello-jni/
2. Runndk-build
The following interface is displayed, indicating that the basic variable is successfully configured ..
In tutorial 2, I will continue to introduce how to configure and use Android studio.
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger. (For more information, see AllenCoder)