`
reymont
  • 浏览: 525865 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

Maven开发Android指南 5 调试

阅读更多

对于一个使用MavenAndroid应用,调试看起来是个大问题,没有"Debug as Android application"怎么办?总不能一直用logcatLog.v(TAG,…)吧。

 

如果阅读了《Maven开发Android指南 4 Eclipse整合(m2e-android 》,那么这就不是问题了。

 

m2e-android很智能的将 Android Developer Tools (ADT) Maven Android Plugin结合在一起,细心的读者可以看到,左上角项目图标上面有一个MA,分别代表着MavenAndroid

 

正如上篇提到到的,可以"Run as Android application",那么当然可以"Debug as Android application"

 

 

 

但是还是有些读者不满足,就是不喜欢"Debug as Android application",那么DDMS将是你的选择。(需要安装m2e-android

 

通过命令部署Android应用

cd HelloM2EAndroid

mvn android:emulator-start

mvn clean package android:deploy

 

打开Eclipse中的DDMS,选择对应的应用,点击绿色的小甲壳虫,它将会帮你抓住所有断点。

 

 

 

 

 

 

 

 

名词解释:

logcatAndroid中一个命令行工具,可以用于得到程序的log信息。

The Android logging system provides a mechanism for collecting and viewing system debug output. Logs from various applications and portions of the system are collected in a series of circular buffers, which then can be viewed and filtered by the logcat command. You can use logcat from an ADB shell to view the log messages

DDMS的全称是Dalvik Debug Monitor Service,是 Android 开发环境中的Dalvik拟机调试监控服务。它为我们提供例如:为测试设备截屏,针对特定的进程查看正在运行的线程以及堆信息、Logcat、广播状态信息、模拟电话呼叫、接收SMS、虚拟地理坐标等等。

Android ships with a debugging tool called the Dalvik Debug Monitor Server (DDMS), which provides port-forwarding services, screen capture on the device, thread and heap information on the device, logcat, process, and radio state information, incoming call and SMS spoofing, location data spoofing, and more

 

参考:

http://code.google.com/p/maven-android-plugin/wiki/Debug

http://baike.baidu.com/view/4504801.htm

http://baike.baidu.com/view/2688850.htm

http://developer.android.com/tools/help/logcat.html

http://developer.android.com/tools/debugging/ddms.html

  • 大小: 29.6 KB
0
0
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics