- 在Windows安装Cygwin
- 设置Windows PATH:
<PATH>\Cygwin\bin;
<PATH>\android-sdk-windows\platform-tools;
<PATH>\android-sdk-windows\tools;
<PATH>\android-ndk-r6;
<PATH>\android-ndk-r6\toolchains\x86-4.4.3\prebuilt\windows\bin - 设置Windows 用户变量 NDK:<PATH>\android-ndk-r6
- 编辑代码test-libstl.cpp
#include <cerrno> #include <cstddef> #include "stdio.h" int main(void) { printf("hello world\n"); return 0; }
- 运行Cygwin
$cd $NDK $cd samples/test-libstdc++ $ndk-build
- Create AVD: AVD2.3.3
- Run Emulator
emulator -avd AVD2.3.3 -partition-size 128 -no-boot-anim
- Push file
$adb remount $adb push libs/armeabi/test-libstl /system/bin
- Run the programe
$adb shell #chmod 777 /system/bin/test-libstl #test-libstl