标签:
1 download NDK for mac
http://developer.android.com/tools/sdk/ndk/index.html
2 解压android-ndk-r10e-darwin-x86_64.bin
终端 cd 目录下
ndk$ chmod a+x android-ndk-r10c-darwin-x86_64.bin ndk$ ./android-ndk-r10c-darwin-x86_64.bin
解压对应的文件夹
http://developer.android.com/ndk/downloads/index.html#extract
3 Eclipse中配置
Window > Preferences > Android >NDK > NDK Loaction
4 环境变量中配置
打开当前用户目录下 .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/AndroidSDK export ANDROID_HOME=/Users/zhouxiyuan/Downloads/AndroidSDK export NDK=/Users/zhouxiyuan/Downloads/tools/android-ndk-r10e
5 编译.so
终端 cd 项目目录下
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.so zhouxiyuandeMacBook-Pro:Ndk_HelloWorld zhouxiyuan$ ndk-build [armeabi] Install : libHello.so => libs/armeabi/libHello.so zhouxiyuandeMacBook-Pro:Ndk_HelloWorld zhouxiyuan$ ndk-build
在对应的lib中生成.so文件
感觉比windows下方便多了 cygwin以前让我好纠结啊 ubuntu 开发部现实
标签:
原文地址:http://my.oschina.net/kylinhuang/blog/465653