views:

505

answers:

1

I am trying to debug the android source using Eclipse by following the instructions found at:

http://source.android.com/using-eclipse

I have downloaded the source, and gotten it to build. I follow the directions in the link above and everything is fine until I run the ddms command. At this point, if Eclipse is running I get the error 'Could not open Selected VM debug port (8700)'. If I close Eclipse, then ddms runs with no problem, and I can the the processes on the emulator. However, if I now open Eclipse, I get the same error.

In any case, no matter what I do, if I attempt to remote debug, it always fails with 'Failed to connect to remote VM'.

Any ideas?

Thanks

+1  A: 

It looks like you have two problems:

  1. You are trying to run DDMS twice. You do not need to run the free standing version of DDMS since there is version of it integrated in Eclipse as part of the Android plug-in. If you change to the DDMS perspective in Eclipse, I'm sure you will find that all the same features are available.

  2. You have not told DDMS which VM you want to debug at localhost:8700. Before you attempt to establish your remote debug connection, you must go to the DDMS perspective and click on the system_process (or whatever process you want to debug).

Tim Kryger
Thanks for the response.I thought I might not need DDMS,so I tried debugging without it, but I could still not get it to work. Here is what I am doing.1) The Android emulator is running, and the process I want to debug is running.2) Start Eclipse3) Choose Run/Debug Configurations from the menu4) Choose the "android-debug" options under "Remote Java Application".4) Set Host to 'localhost' and Port to 8700.5) Click Debug6) I get get the message 'Failed to connect to remote VM'Any ideas?Thanks(Why am I restricted to so few characters in these responses?)
John Gaby
Also note that if Eclipse is not running and I run DDMS, it does successfully connect to the emulator, and I can see all the processes.
John Gaby
I'm not sure what "android debug" option under "Remote Java Application" you are talking about but I still think your problem is that you haven't selected the process you want to debug in DDMS and you really should just use the DDMS integrated into Eclipse.
Tim Kryger
I appreciate your help! I would love to use the DDMS that is integrated into Eclipse, but I apparently don't know how to do that. I am using the "Run Configurations" that is on the "Run" menu. This brings up a "Debug Configurations" dialog. In the panel on the left there is a "Remote Java Application" entry. If I open it, there is an 'android-debug' options. I select that option. I take it that I should be doing something else? Can you point me in the right direction. Thanks.
John Gaby
Assuming you have [installed the Android plug-in](http://developer.android.com/sdk/eclipse-adt.html) already, open Eclipse and select Window->Open Perspective->Other... then pick DDMS.
Tim Kryger
That seems to work. I have some new issues now, but at least I am past that one. Thank you very much for your help!
John Gaby