Programming/Non programming

Saturday, March 8, 2014

How to Debug An Android application through Eclipse?

How to Debug An Android application through Eclipse?

1. Open "AndroidManifest.xml" of your Android project in Eclipse.
2. Choose "Application" tab
3. Change "Debuggable" option as "true"

4. Go to your project source files and identify the lines where you want to debug, and add break point by enabling "Toggle breakpoint" from "Run" menu (or) Right click the left most area in the source file to enable "Toggle breakpoint" option.
5. Right click project "Debug As" -> "Android Application"

When the application is running, automatically it will stop at debug points. You can verify logs in LogCat.

Hope, it will help someone!

Thank you Guys!

Regards,

Prabakar. M.P

Technical Architect




How to stop the android application running on the device through eclipse

Stopping android app:

When you are running your android application in the emulator of Android, you always can stop it by closing the emulator. But, to stop it running on the device through Eclipse, you can find the better following way,

1. On the top right side of Eclipse, you can see an icon with the symbol of Andoid and some character "DDMS". Press it.
You can do the same pressing:
Windows -> Open perspective -> Other... -> DDMS

2. In the Android view, on the left windows, you can see "Devices". There should be a list of applications that is running now (Emulator or physical devices).
Click on the application you want to close. 
3. Now click on the symbol of "Stop".

To come back to the normal view, you just have to press on the Java button on the top right side.
You can also do it pressing:
Windows -> Open perspective -> Other... -> Java 

Hope it finds some help to someone :)

Cheers,

-Prabakar M.P
Technical Architect.