debugging in android
I am using eclipse as the IDE and I have written small programs but now I want to debug 开发者_开发问答them so that i could check the flow of control
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. Now Eclipse will connect the debugger to your emulator or phone and open the debugger once you are reaching the breakpoint.
If the breakpoint is not reached have a look at your manifest.xml file and be sure to mark your application as debuggable.
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">
精彩评论