1 Download NDK for Mac
Http://developer.android.com/tools/sdk/ndk/index.html
2 Decompression Android-ndk-r10e-darwin-x86_64.bin
The Terminal CD directory
ndk$ chmod a+x android-ndk-r10c-darwin-x86_64.binndk$./android-ndk-r10c-darwin-x86_64.bin
Unzip the corresponding folder
Http://developer.android.com/ndk/downloads/index.html#extract
3 Configuration in Eclipse
Window > Preferences > Android >ndk > NDK loaction
4 Configuring in Environment variables
Open the current user directory. Bash_profile
Export Path=${path}:/users/zhouxiyuan/downloads/androidsdk/platform-tools/export path=${path}:/users/zhouxiyuan/ Downloads/tools/android-ndk-r10e/export Android_sdk=/users/zhouxiyuan/downloads/androidsdkexport ANDROID_HOME=/ Users/zhouxiyuan/downloads/androidsdkexport ndk=/users/zhouxiyuan/downloads/tools/android-ndk-r10e
5 compiling. So
Terminal CD Project directory
Ndk-build
Zhouxiyuandemacbook-pro:ndk_helloworld zhouxiyuan$ Ndk-build[armeabi] Compile thumb:hello <= Hello.c[armeabi] Sharedlibrary:libhello.so[armeabi] Install:libHello.so = libs/armeabi/libhello.sozhouxiyuandemacbook-pro:n Dk_helloworld zhouxiyuan$ Ndk-build[armeabi] Install:libHello.so = Libs/armeabi/libhello.sozhouxiyuandemacboo K-pro:ndk_helloworld zhouxiyuan$ Ndk-build
Generate the. So file in the corresponding Lib
It feels more convenient than windows. Cygwin used to make me so tangled. Ubuntu Development Department Reality
MAC NDK Environment Setup