Ubuntu 11.04 下搭建Android(安卓)NDK开发环境
16lz
2021-12-04
第一步、下载 Android NDK, Revision 6b
[plain] view plain copy print ?- wget-chttp://dl.google.com/android/ndk/android-ndk-r6b-linux-x86.tar.bz2
wget -c http://dl.google.com/android/ndk/android-ndk-r6b-linux-x86.tar.bz2
第二步:解压安装
[plain] view plain copy print ?- tarjxvfandroid-ndk-r6b-linux-x86.tar.bz2
tar jxvf android-ndk-r6b-linux-x86.tar.bz2
第三步:修改环境变量
[plain] view plain copy print ?- vim~/.bashrc
vim ~/.bashrc
添加:
[plain] view plain copy print ?- exportNDK_HOME=$HOME/android-ndk-r6b
- exportPATH=$PATH:$NDK_HOME
export NDK_HOME=$HOME/android-ndk-r6bexport PATH=$PATH:$NDK_HOME
保存退出,输入以下命令使之立即生效。
[plain] view plain copy print ?- source~/.bashrc
source ~/.bashrc
第四步:测试
切换到NDK目录samples下的工程hello-jni下,执行ndk-build。如果能够正常执行,生成底层库*.so,则测试成功。 [plain] view plain copy print ?- snowdream@snowdream:~$cd$NDK_HOME/samples/hello-jni
- snowdream@snowdream:~/android-ndk-r6b/samples/hello-jni$ndk-build
- Gdbserver:[arm-linux-androideabi-4.4.3]libs/armeabi/gdbserver
- Gdbsetup:libs/armeabi/gdb.setup
- Compilethumb:hello-jni<=hello-jni.c
- SharedLibrary:libhello-jni.so
- Install:libhello-jni.so=>libs/armeabi/libhello-jni.so
snowdream@snowdream:~$ cd $NDK_HOME/samples/hello-jnisnowdream@snowdream:~/android-ndk-r6b/samples/hello-jni$ ndk-build Gdbserver : [arm-linux-androideabi-4.4.3] libs/armeabi/gdbserverGdbsetup : libs/armeabi/gdb.setupCompile thumb : hello-jni <= hello-jni.cSharedLibrary : libhello-jni.soInstall : libhello-jni.so => libs/armeabi/libhello-jni.so
参考链接:
ubuntu NDK 的安装 http://blog.csdn.net/hdhd588/article/details/6688228
更多相关文章
- 如何在G1上安装非android market的apk
- android gps开发必备资料(含测试demo下载)
- Android中配置单元测试
- virtualbox 安装android设置分辨率(自定义)
- Android中使用ViewPage进行广告轮播测试代码
- Android中如何收听特定应用安装成功的广播
- Android自学笔记(番外篇):全面搭建Linux环境(六)——Android的安装与
- android 全屏显示
- Android(安卓)Studio开发环境的搭建