Could not open Selected VM debug port (8700)
I solved it by ending the process "adb.exe" through Task Manager and then reloading the SDK through Windows->Preference..I am running Eclipse Indigo on Win 7 64-bit.
It looks like you have two problems:
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.
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).
I was having that problem too (Windows 7), even though my /Windows/system32/drivers/etc/hosts file already had 127.0.0.1 localhost
in it.
I tried changing the ADBHOST info & port in the eclipse Preferences, but that didn't do anything.
netstat -b
shows '127.0.0.1' as the source address for adb and the emulator, but always lists my machine host name as the 'foreign address.' On a hunch, I tried debugging with my machine not connected to any network (no WiFi, nothing plugged in)... and it worked! (DDMS was able to connect to the VM on the emulated device and I was able to debug just fine.)
I think that messages sent by DDMS &/or adb are not staying on my local machine (they're getting sent to my local router). (It's just a guess; I don't know how to conclusively test that.) IOW, loopback wasn't working as it should.
Since I already had 127.0.0.1 in my localhosts, I added the local subnet address of my machine into my hosts file, guessing that DDMS/adb might be using that address (vs. 127.0.0.1). That seemed to solve the problem for me.
So now my hosts file has these lines:
127.0.0.1 localhost ::1 localhost 192.168.1.102 localhost
(The local IPv4 address for my machine is 192.168.1.102 . You can check yours with the ipconfig
command.)
(I came across some webpages that how to set up a virtual network adapater for Windows that handles loopback, e.g. Setting up a Microsoft Loopback Adapater (from Oracle Distilled), but haven't had time to take that in and see if that's a viable solution to all of this, too.)
The Windows Host file that is messed up is at C:\WINDOWS\system32\drivers\etc
, and it should contain this line:
127.0.0.1 localhost
If that doesn't work, then try making the following changes in Eclipse.
Under Window -> Preferences -> Android -> DDMS:
- Set Base local debugger port to "8601"
- Check the box that says "Use ADBHOST" and the value should be
127.0.0.1