调试与Android Maven插件应用程序启动 [英] debugging an app startup with android maven plugin

查看:169
本文介绍了调试与Android Maven插件应用程序启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我与Android Maven插件的最新版本的工作。我使用Android:部署和android:运行发动我的设备上我的应用程序。当我想调试,我进入DDMS在Eclipse和检查绿色的bug按钮为我的应用程序。一切正常......但我只能调试运行的应用程序,也就是说,它已经开始了。如果我把一个断点在我的应用程序构造函数或的onCreate,它不会停止(显然是因为应用程序已启动和调试并没有被激活......还)。

I'm working with the latest version of android maven plugin. I use android:deploy and android:run to launch my app on my device. When I want to debug, I go into DDMS in eclipse and check the green bug icon for my app. Everything works fine... but I can only debug a running app, ie it has already started. If I put a breakpoint in my application constructor or onCreate, it wont stop (obviously because the application has started and the debugging didn't been activated... yet).

所以我的问题是:我该如何开始我在调试模式下的应用程序直接从行家像我会做一个应用程序,我从日食开始

So my question is: how can I start my app in debug mode directly from maven like I would do for an app that I start from eclipse ?

由于提前

推荐答案

感谢卢卡斯,我发现在启动触发调试模式理念的命令。
基本上,部署应用程序与Android:部署但不是机器人:跑,我推出了壳是与-D命令。下面是有兴趣的人使用。

Thanks to Lukasz, I found the command in Idea that is launched to trigger the debug mode. Basically, the application is deployed with android:deploy but instead of android:run, I launch a shell "am" command with -D. Here's the usage for anyone interested.

ovh-ybi$ adb shell
# am
usage: am [subcommand] [options]

start an Activity: am start [-D] <INTENT>
    -D: enable debugging

send a broadcast Intent: am broadcast <INTENT>

start an Instrumentation: am instrument [flags] <COMPONENT>
    -r: print raw results (otherwise decode REPORT_KEY_STREAMRESULT)
    -e <NAME> <VALUE>: set argument <NAME> to <VALUE>
    -p <FILE>: write profiling data to <FILE>
    -w: wait for instrumentation to finish before returning

start profiling: am profile <PROCESS> start <FILE>
stop profiling: am profile <PROCESS> stop

<INTENT> specifications include these flags:
    [-a <ACTION>] [-d <DATA_URI>] [-t <MIME_TYPE>]
    [-c <CATEGORY> [-c <CATEGORY>] ...]
    [-e|--es <EXTRA_KEY> <EXTRA_STRING_VALUE> ...]
    [--ez <EXTRA_KEY> <EXTRA_BOOLEAN_VALUE> ...]
    [-e|--ei <EXTRA_KEY> <EXTRA_INT_VALUE> ...]
    [-n <COMPONENT>] [-f <FLAGS>] [<URI>]

这篇关于调试与Android Maven插件应用程序启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆