简体   繁体   English

在android中调试

[英]debugging in android

我正在使用eclipse作为IDE,并且已经编写了一些小程序,但是现在我想调试它们,以便可以检查控制流。

If you are using eclipse you can just set a breakpoint as in any usual Java Application and then do a right click on your project and select Debug as -> Android Application instead of Run as -> Android Application. 如果您使用的是eclipse,则可以像在任何常规Java应用程序中一样设置断点,然后右键单击您的项目,然后选择“调试为-> Android应用程序”而不是“运行为-> Android应用程序”。 Now Eclipse will connect the debugger to your emulator or phone and open the debugger once you are reaching the breakpoint. 现在,Eclipse将调试器连接到您的仿真器或电话,并在到达断点后打开调试器。

If the breakpoint is not reached have a look at your manifest.xml file and be sure to mark your application as debuggable. 如果未达到断点,请查看manifest.xml文件,并确保将应用程序标记为可调试。

For that you have to add the attribute debuggable to your application tag. 为此,您必须将可调试属性添加到应用程序标签中。

<application
    android:icon="@drawable/logo"
    android:name="Name"
    android:label="@string/app_name"
    android:debuggable="true">

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM