简体   繁体   中英

How to Debug Android application line by line using Eclipse?

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.

  1. 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.

  2. once a breakpoint has been hit you can step over ( f6 ) or step into ( f5 ) (check the Run menu for more commands).

在你想要开始调试的行上放置一个断点,然后在调试模式下运行应用程序,应用程序将点击断点然后你可以像在VS中一样完成它。

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:

  1. Run >> Debug Configurations...
  2. Click "Debug" to take the defaults

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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