How to enable the message "Waiting for a debugger"?

I have an HTC Comet connected to Eclipse with the SDK 2.2. I am doing a debug build - the application does not start; although it is installed on the device. On the device, I get this message box on the comet screen

Waiting for debugger
The HunyDew application (com.airvine.hunydew process) is waiting for a debugger to join.
[Force Close]

While in the Eclipse console I get this message set

[2010-12-07 01:42:29 - hunydewprj] Android Launch! [2010-12-07 01:42:29 - hunydewprj] adb is running normally. [2010-12-07 01:42:29 - hunydewprj] Performing com.airvine.hunydew.HunyDewAAStartsHere activity launch [2010-12-07 01:42:47 - hunydewprj] Application already deployed. No need to reinstall. [2010-12-07 01:42:47 - hunydewprj] Starting activity com.airvine.hunydew.HunyDewAAStartsHere on device 308730C861BC [2010-12-07 01:42:49 - hunydewprj] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.airvine.hunydew/.HunyDewAAStartsHere } [2010-12-07 01:42:49 - hunydewprj] Attempting to connect debugger to 'com.airvine.hunydew' on port 8601 [2010-12-07 01:43:09 - hunydewprj] Launch error: Failed to connect to remote VM. Connection timed out. 

The application works fine in the emulator - please help - what am I missing here? Any hints / suggestions? Thanks

+89
android debugging eclipse device adb
Dec 07 '10 at 10:01
source share
30 answers

Some devices will allow the debugger to join if the application has the android.permission.SET_DEBUG_APP permission set in its manifest file:

 <manifest> <uses-permission android:name="android.permission.SET_DEBUG_APP"></uses-permission> </manifest> 
+68
Dec 07 '10 at 10:15
source share

The Waiting for Debugger dialog is displayed; if you are creating a debugging application or somewhere in your source code, you call Debug.waitingForDebugger ();

Inside Android Studio 2.0 and higher, there is the Attach Debugger to Android Process option. This is the last menu item in the Run menu.

Screenshot of startup menu options in Android Studio

+43
Sep 13 '16 at 11:20
source share

Not sure if this is what you are looking for, but try putting:

 android:debuggable="true" 

in the application tag in AndroidManifest.xml

+19
Dec 26 '10 at 17:04
source share

I get this if I switch the USB cable to the differential port on my PC, strange, but it works when I return it again. I also think that I have it when another device or emulator, or two instances of Eclipse open, is running at the same time.

+10
Dec 07 '10 at 11:37
source share

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.

+10
Dec 25 2018-11-12T00:
source share

For those who get this annoying behavior in 4.2.2, you need to cancel the "wait for debugger" setting in the developer settings. Of course, these options were hidden by Google, and you need to do a tricky trick to get them to show the backup. I set them before they disappeared, and I couldn’t let my life find them again.

This page explains the procedure.

+4
May 22 '13 at 18:15
source share

My solution is to use the Dalvik Debug Monitor. Sometimes a red or green error occurs in the process. Click on the device you are trying to download. Select the "Actions" tab and reset adb. This usually debugs me. I believe that debugging through this monitor works better for me than using the Android Eclipse Logcat plugin.

+3
Jun 30 '11 at 15:36
source share

I end up with Debug.

Then in the "Debug" frame there is a debug list or an execution list.

You have to decide which one is your current one that has this problem (Waiting for debugging ...)

Then right-click and select Finish and Delete.

Then you try to start again. And this warning window will disappear.

+2
Oct 07 '11 at 17:51
source share

Emulator closure and eclipse closure. Re-opening Eclipse and running the simulator worked for me.

The main thing to look for is in the Eclipse Devices panel. If you run an emulator or device, and it appears in the list of device names, but says [null], and no running processes will be displayed under it, then it will not work correctly with loading your application into it.

If the device name appears and is online, everything looks fine.

I don't know why this is not working all the time.

+2
May 18 '12 at 20:54
source share

Starting Android Studio, I ran into this problem, and after you tried various tools by restarting Android Studio, the problem is that the problem is fixed.

+2
Mar 13 '15 at 9:41
source share

In my case, the problem is caused by connecting adb to another device.

If several devices are connected to the PC, delete devices other than the required one.

+2
Aug 18 '15 at 8:41
source share

If your development environment is Windows, make sure the USB drivers are installed correctly.

One way to verify that the USB drivers are installed correctly is to install the Windows PDANet installer and install the USB drivers.

Here you can find the PDANet page .

+1
Dec 26 '10 at 17:37
source share

I would try to connect to the phone using ddms myself without Eclipse. Perhaps you are running an emulator inside an eclipse that you do not see or have other problems with Eclipse.

Just start ddms from the command line and see if the device is displayed and you can connect to it.

You can also see if adb devices appears when you start and see that your phone is listed (and maybe something else ..)

+1
Dec 31 '10 at 18:33
source share

I have the same problem, I know that I did not have any other instances, and I could see it with adb devices . I just restarted eclipse and it worked.

+1
Mar 17 '11 at 16:19
source share

Rebooting the PC was the only thing that worked for me. It worked when I had this problem with an Android 2.2 phone as well as an Android 3.1 tablet.

+1
Feb 01 2018-12-12T00:
source share

I solved this problem as follows:

Go to the Run menu ====> click Change Configuration ==== → Various and finally clear the Skip installation if APK has not changed

enter image description here

enter image description here

+1
Oct 28 '16 at 17:07
source share

Today I ran into this problem. After spending most of the day trying to fix this, the only thing that worked was to create a new workspace and import my project into it. Hope this helps someone avoid all the troubles that I experienced.

0
Mar 15 2018-11-11T00:
source share

I had the same problem, I fixed it by explicitly selecting the desired device in the debug configuration. Unfortunately, even after this, the log sometimes stops when the debugger tries to connect. In this case, in the DDMS perspective, find the desired process. It will be highlighted with a green error. Click Stop, and then debug it again.

0
Jan 26 '12 at 11:45
source share

I am also considering this issue. In my environment, I use tomcat as a server and android as a client. I found, If tomcat is running, this error is "Startup error: Could not connect to the remote virtual machine. Connection timed out." will happen. If tomcat is not running, adb works well.

0
May 19 '12 at 14:33
source share

I tried all of the above solutions, sometimes this fixes the problem, but from time to time I had to get stuck in the "Waiting for a debugger in the application" message box.

The final solution in my case was to disable all Android devices, but the one I want to debug. I don’t know which one is guilty: Nexus 7 runs JB 4.2, HTC One X running ICS, HTC Desire S running Gingerbread, or combination 3, but as soon as I have only one device connected to the network, It works smoothly like silk.

0
Jan 07 '13 at 10:02
source share

I used task manager to kill adb.exe to solve this problem. Adb.exe will automatically start after it is killed.

Killing adb.exe decided to solve many problems related to debugging and emulator.

0
Nov 07 '13 at 13:37
source share

For Android Studio users, I first encountered this problem when trying to start a bone project right after updating my jdk location. So I came across this post. In my case, a simple Build-> Clean Project completed the task.

0
Jul 14. '14 at 14:15
source share

I also had the same issue when using Android Studio and GenyMotion. I can solve this problem by pausing the program and resuming it again after the message “Waiting for debugger” appears. It can work when using other IDEs and emulators. enter image description here

0
Apr 08 '15 at 18:17
source share

Android Studio 1.2.2 on Mac OS 10.10 The same problem as the others. I closed Android Studio and then checked from the command line in the terminal:

ps -efw | grep -i android

A java process (.gradle / daemon) related to Android Studio is reported. I killed this process, restarted Android Studio, and the problem disappeared.

0
Jun 18 '15 at 19:33
source share

disable the developer option on the phone.

Settings> Developer Options> Disable

This worked for me when I tried to use my application without debugging it.

0
Jul 28 '15 at 8:20
source share

What the problem solved for me, I was going to: “Run” → “Attach the debugger to the Android process”, and then select your process.

You do this in Android Studio.

0
01 Sep '15 at 17:38
source share

This may be old, but for the latest Genise 2007 update 2.7.1 go to Developer options , if you don’t know how to open this option, go to About phone and click Build number several times and the developer options will be enabled. To enable Developer, check USB Debugging .

Tested in Genymotion 4.4 and higher. Strange decision? But it definitely works. Hope it helps. Happy encodings.

0
Jul 13 '16 at 5:36
source share

In debug mode, Android Studio connects to your device through a socket (: 8600). Somehow your socket connection cluttered and thus did not respond to incoming connections.

Restart Android Studio and your problem will be resolved.

0
Sep 03 '16 at 6:02
source share

Read a lot about it, and the only solution that worked for me was to create a new project and then copy the old project back into it.

-one
May 11 '17 at 16:18
source share

"Wait while the debugger" in the developer settings may have been configured to wait for your application. Please clear this option and the application should work fine.

-one
Jun 13 '17 at 6:12
source share



All Articles