I have this problem for a long time that I can not get the emulator or my Android device to connect to the debugger while it is displayed on the console and the emulator , waiting for the connection to the debugger .
And the configuration for debugging inside eclipse also confused me before, but today I solved this problem by following these steps:
If you want to debug an Android project, for example, mypro. you must right-click on it in the "Package Explorer". Then choose "Debug as"-->"Android Application" "Package Explorer". Then choose "Debug as"-->"Android Application" .
Then the emulator can stop at "Waiting for connection to the debugger" (or something else similar to this).
Then you need to connect to the debugger yourself by clicking “DDMS” to open the DDMS perspective and click on the “Devices” tab.
Then you can see a list of processes that are running on your emulator or device.
Double-click on the one you are debugging, and then go to the "Debugging" perspective, you will see that the debugger is connected, and you can debug your program. This is how I solved this problem.
By the way, my OS is 32-bit Win7. Eclipse version - Helios Service Release 2. Android SDK - rev. 16 and platform tools. "
Refresh.
I found that this is a TCP / IP configuration problem. The debugger cannot be connected when I assign a static IP address (for access to the Internet).
Therefore, every time the debugger cannot connect, I always do the following steps:
Window 1.close current eclipse.
2. Change the configuration of the IP address to dynamic , this means obtaining a DHCP IP address.
3. Close the eclipse again.
then the debugger can be connected. I thought this might be a problem of the internal java debugger mechanism that uses a socket connection.