Reputation: 27659
I am familiar with VS.Net IDE & it has a lot of support for debugging. But the android development is something new for me. I am using the Eclipse IDE. I was wondering how to debug the android application line by line just like we can do in .Net IDE?
Currently i am using the log window, but i am not happy with it. I need suggestion from the expert guys, what is the best way to debug the Android application using Eclipse?
Great thanks for your valuable time & help.
Upvotes: 50
Views: 68048
Reputation: 659
There are two methods. First you can debug the app from starting.You can do it by Right click on your project->Debug as Android Application.
In second method,you can debug the any activity without restarting the complete app. You can do it so by:- 1) Go to DDMS
2) Now click on small mobile icon with +sign on the bottom tab.
3) Now click on devices. After that list of devices will be showed up with the list of projects.Click on the required project.And click on green colour debug option.Your debug mode is started now.
F3 to go inside a function. F6 for the next line and F8 to go to the next break point.
Upvotes: 0
Reputation: 8190
either start the app by right clicking on the project and select Debug As
->Android Application
or by running it normally and later in the DDMS perspective select the running app in your devices pane and click on the green bug.
once a breakpoint has been hit you can step over (f6
) or step into (f5
) (check the Run menu for more commands).
Upvotes: 67
Reputation: 1647
I just set up the Eclipse included in the Android Development Tools (ADT), the adt-bundle-mac-x86_64-20131030 version. Setting the property in the manifest file gave me a warning saying that it would be better to set up different Run and Debug configurations. It turns out that I simply needed to create a debugging profile:
Now you can go to Run >> Debug to run on the device. (Assuming that the device has debugging enabled, of course)
If you are an Eclipse or ADT developer and are reading this, I strongly suggest that Eclipse create a debugging configuration by default.
Upvotes: 1
Reputation: 27659
Well i found some articles which guides how to debug using Eclipse.
1- Free video tutorial will teach you how to use the Eclipse Java Debugger
2- Debugging with the Eclipse Platform
3- 5 Tips for Debugging Java Code in Eclipse
4- Java Debugging with Eclipse - Tutorial
Upvotes: 12
Reputation: 4307
Put a breakpoint on the line you want to start debugging from, then Run the Application in Debug mode, the app will hit the breakpoint and then you can go through it just like in VS.
Upvotes: 3