【Android Native Code开发系列】 五 运行、调试编译的Native Code项目
来源:互联网 发布:淘宝一心店铺出售 编辑:程序博客网 时间:2024/04/30 00:56
#######################################
Run,Debug自己编译的Native Code项目
#######################################
# 在模拟器上测试自己的代码
1. 先确保自己已经有Android sdk,platform, 以及platform-tools;
要在shell直接运行emulator, android, adb等命令,请把相应的路径添加到PATH;
如果用eclipse启动emulator,然后在shell执行adb push可能会出现"out of
memory"错误,目前解决方法是也从shell启动emulator,若还出错,加-partition-size xxx参数,xxx为容量
2. 启动emulator. 关于如何创建模拟器见“#官方android开发介绍”
zp@zp-desktop:~/ndktest$ emulator -avd avd2.3.3 -scale 0.5
-scale选项会调整模拟器的界面大小.
3. 将自己编译的模块拷贝到virtual device
zp@zp-desktop:~$ adb push ndktest/libs/armeabi/zptest /data
163 KB/s (8476 bytes in 0.050s)
如果要将东西拷贝到system目录,要在adb push之前执行:
adb remount
4. 在avd上执行自己的程序
zp@zp-desktop:~$ adb shell
# /data/zptest
hello Android!
也可以在avd界面上执行, 方法是打开应用程序库 > Dev Tools > Terminal Emulator,
Run,Debug自己编译的Native Code项目
#######################################
# 在模拟器上测试自己的代码
1. 先确保自己已经有Android sdk,platform, 以及platform-tools;
要在shell直接运行emulator, android, adb等命令,请把相应的路径添加到PATH;
如果用eclipse启动emulator,然后在shell执行adb push可能会出现"out of
memory"错误,目前解决方法是也从shell启动emulator,若还出错,加-partition-size xxx参数,xxx为容量
2. 启动emulator. 关于如何创建模拟器见“#官方android开发介绍”
zp@zp-desktop:~/ndktest$ emulator -avd avd2.3.3 -scale 0.5
-scale选项会调整模拟器的界面大小.
3. 将自己编译的模块拷贝到virtual device
zp@zp-desktop:~$ adb push ndktest/libs/armeabi/zptest /data
163 KB/s (8476 bytes in 0.050s)
如果要将东西拷贝到system目录,要在adb push之前执行:
adb remount
4. 在avd上执行自己的程序
zp@zp-desktop:~$ adb shell
# /data/zptest
hello Android!
也可以在avd界面上执行, 方法是打开应用程序库 > Dev Tools > Terminal Emulator,
在出现的控制台输入'/data/zptest'
转自http://blog.csdn.net/blackboyofsnp/article/details/7242568
0 0
- 【Android Native Code开发系列】 五 运行、调试编译的Native Code项目
- 【Android Native Code开发系列】 五 运行、调试编译的Native Code项目
- 【Android Native Code开发系列】四 编译自己的Native Code
- 【Android Native Code开发系列】四 编译自己的Native Code
- Android Native Code调试
- 【Android Native Code开发系列】三 Android源码的编译环境配置、下载及编译
- 【Android Native Code开发系列】三 Android源码的编译环境配置、下载及编译
- 【Win7下Android native code的编译和调试】
- 【Win7下Android native code的编译和调试】
- Win7下Android native code的编译和调试
- Win7下Android native code的编译和调试
- 【Android Native Code开发系列】一 前言
- 关于Android pure native code的调试
- 【Android Native Code开发系列】六 一个Native Service的完整示例
- 【Android Native Code开发系列】六 一个Native Service的完整示例
- 【Android Native Code开发系列】一个Native Service的完整示例 1234567
- 【Android Native Code开发系列】六 一个Native Service的完整示例
- 【Android Native Code开发系列】七 使用NDK进行交叉编译 & 编译ACE for android
- 【DRP】Oracle10g错误—java.lang.Exception:Exception in sending Request::null
- HDU 4417-Super Mario(划分树-二分查找)
- Hadoop集群WordCount详解(二)
- 2016sdau课程练习专题三 1010
- 如何将源代码编译后的文件(lib库/bin/jar/apk等)编译到android中
- 【Android Native Code开发系列】 五 运行、调试编译的Native Code项目
- AndroidImageSlider超炫的轮播图效果
- HashMap的实现原理
- constexpr 和 inline
- 介绍const
- 毛刺修剪
- Java线程详解
- 巴什博弈
- 【Android Native Code开发系列】六 一个Native Service的完整示例