[android] How to resolve "Waiting for Debugger" message?

I have HTC Comet connected to Eclipse with SDK 2.2. I do a debug build - the application does not run; though it does get installed on the device. On the device I get this message box on the Comet screen

Waiting for Debugger
Application HunyDew (process com.airvine.hunydew) is waiting for the debugger to attach.
[Force Close]

Whereas in the Eclipse console I get these set of messages

[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 runs fine in the Emulator - please help - what is it that I am missing here? Any hints/suggestions? Thanks

This question is related to android eclipse debugging device adb

The answer is


In my case, the problem is caused by adb connected with another device.

If several devices are connected in PC, remove other devices except required one.


Running Android Studio, I ran into this problem and after trying various remedies restarting Android Studio is what appeared to fix the problem.


What solved the problem for me was going to: "Run"->"Attach Debugger to Android process" and then select your process.

You do this in Android Studio.


For Android Studio users I encountered this problem first time while trying to run a bare bone project just after updating my jdk location. So I stumbled across this post. In my case simple Build->Clean Project did the job.


I get this if I switch the usb cable to a difference port on my PC, odd but it works when I switch it back again. Also I think I've got this when there's been another device or emulator running at the same time, or two instances of Eclipse open.


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


This may be old, but for Genymotion's latest update 2.7.1, go to Developer options, if in case you dont know how to open that option, go to About phone and click Build number few times and Developer options will be enabled. Turn ON Developer option, check USB debugging.

Tested on Genymotion 4.4 and up. Weird solution eh ? But definitely works. Hope it helps. Happy codings.


Closing the emulator and closing eclipse. Reopening Eclipse and starting the simulator worked for me.

The key thing to look for is in the Devices pane of Eclipse. If you start the emulator or device and it shows up in the device name list but says [null] and no running processes show beneath it, then it won't work correctly with loading your app into it.

If the name of the device comes up and is Online then things seem to work smoothly.

Don't know why it doesn't work out all the time though.


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


My solution is to use the Dalvik Debug Monitor. Sometimes there is a red or green bug beside a process. Click on the device you're trying to load to. Select the Actions tab and reset adb. This usually attaches the debugger for me. I find that doing debugging through this Monitor works better for me than using the Android Eclipse plugin Logcat.


I also enounter this problem. In my environment, I use a tomcat as server and android as client. I found, If tomcat is started, this error " Launch error: Failed to connect to remote VM. Connection timed out." will occur. If tomcat is not run, adb works well.


Android Studio 1.2.2 on Mac OS 10.10 Same problem as others have reported. I closed Android Studio, then checked from command line in terminal:

ps -efw|grep -i android

This reported a java process (.gradle/daemon) associated with Android Studio. I killed this process, restarted Android Studio, and the problem went away.


I end up going into "Debug" perspective.

Then in the "Debug" frame, there are debug list or running list.

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

Then do right-click and choose "Terminate and Remove".

Then you try to run again. And that warning box will be gone.


For those getting this annoying behavior in 4.2.2 you have to un-check the setting for "wait for debugger" in the developer options. Of course, those options were hidden by Google, and you have to do a sneaky trick to get them to show back up. I had set them before they disappeared, and couldn't for the life of me find them again.

This page explains the procedure


I got the same problem, I know I wasn't running any other instances, and I could see it with adb devices. I just did a restart of eclipse and it worked.


I was also having the same problem when using Android Studio and GenyMotion. I am able to solve this problem by pausing the program and resuming it again after "Waiting for debugger" message is shown. It may work while using other IDEs and emulators as well.enter image description here


I ran into this problem today. After spending most of the day trying to fix it, the only thing that ended up working was to create a new workspace and import my project into it. I hope this helps someone avoid all the trouble that I went through.


I solved this issue this way:

Go to Run menu ====> click on Edit Configurations ====> Micellaneous and finaly uncheck the option Skip installation if APK has not changed

enter image description here

enter image description here


I tried all the solutions above, it fixes the issue sometimes, but still from time to time I happened to get stuck with the "Waiting for the debugger to attach" message box.

The final solution in my case was to unplug all the Android devices but the one I want to debug on. I don't know which one is the culprit: the Nexus 7 running JB 4.2, the HTC One X running ICS, the HTC Desire S running Gingerbread, or the combintation of the 3, but as soon as I only have one device plugged in, it runs smooth as silk.


Have read alot about this and the only solution that worked for me was to create a new project and then copy old project back into it.


The Dialog Waiting for Debugger is shown if you are building a debug application or somewhere in your source code, you called Debug.waitingForDebugger();

Inside Android Studio 2.0 and above, there is an option of Attach Debugger to Android Process. It is the last menu item in the Run menu.

Screen shot of Run menu options in Android Studio


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

android:debuggable="true"

in the application tag in the AndroidManifest.xml


I used Task Manager to kill adb.exe to solve this problem. Adb.exe will automatically start after being killed.

Killing adb.exe has solved a lot of problems related to debug and emulators for me so far.


In Debug mode Android Studio connects to your Device via socket(:8600). Somehow your socket connection is choked and thus not responding to incoming connections.

Restart Android Studio and your problem will be resolved


I would try to connect to the phone with ddms on its own without Eclipse. You might be running an emulator inside eclipse that you dont see or have some other problems with Eclipse.

Just run ddms from a command prompt and see if the device appears and you can connect to it.

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


I've got this problem for long that I cant get my android emulator or device connect to the debugger while both the console and the emulator were displaying waiting for connecting to the debugger.

And configuration for debug inside eclipse also confused me so much before, but today, i got this problem solved, by the following steps:

When you want to debug a android project, for instance, mypro. you would right click on it in the "Package Explorer". Then choose "Debug as"-->"Android Application".

Then the emulator might stop at the "Waiting for connecting to debugger"(or something else similar to this).

Then you need to connect to the debugger yourself by click "DDMS" to open the DDMS perspective, and click "Devices" tab.

Then you can see a list of processes that are running on your emulator or device.

Double click on the one which you are debugging, then change to the Debug perspective, you can see the debugger is connected and you could debug your program. That's how I solved this problem.

By the way, my OS is Win7 32-bit. Eclipse's version is Helios Service Release 2. Android SDK is rev. 16 and platform-tools' 10.

Update.

I found that it is the problem of my TCP/IP configuration. The debugger can't be connected when i assign a static IP address(for access to internet).

So every time when the debugger is unable to connect, I always do the following steps:

1.close current eclipse window.

2.change the config of IP address to dynamic, it means getting a IP address by DHCP.

3.open up the eclipse again.

then the debugger is able to be connected. I thought it might be a issue of the internal mechanism of java debugger which is using socket connection.


Rebooting the phone was the solution for me.


disable you developer option in your phone.

Settings > Developer option > Disable

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


"Wait for debugger"in Developer options may have been set to wait your application.Please clear that option and application should run normally.


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

One way to ensure that the USB drivers are installed correctly is to get the PDANet Windows installer and let it install the USB drivers.

You can find the PDANet page here.


Examples related to android

Under what circumstances can I call findViewById with an Options Menu / Action Bar item? How to implement a simple scenario the OO way My eclipse won't open, i download the bundle pack it keeps saying error log getting " (1) no such column: _id10 " error java doesn't run if structure inside of onclick listener Cannot retrieve string(s) from preferences (settings) strange error in my Animation Drawable how to put image in a bundle and pass it to another activity FragmentActivity to Fragment A failure occurred while executing com.android.build.gradle.internal.tasks

Examples related to eclipse

How do I get the command-line for an Eclipse run configuration? My eclipse won't open, i download the bundle pack it keeps saying error log strange error in my Animation Drawable How to uninstall Eclipse? How to resolve Unable to load authentication plugin 'caching_sha2_password' issue Class has been compiled by a more recent version of the Java Environment Eclipse No tests found using JUnit 5 caused by NoClassDefFoundError for LauncherFactory How to downgrade Java from 9 to 8 on a MACOS. Eclipse is not running with Java 9 "The POM for ... is missing, no dependency information available" even though it exists in Maven Repository The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. on deploying to tomcat

Examples related to debugging

How do I enable logging for Spring Security? How to run or debug php on Visual Studio Code (VSCode) How do you debug React Native? How do I debug "Error: spawn ENOENT" on node.js? How can I inspect the file system of a failed `docker build`? Swift: print() vs println() vs NSLog() JavaScript console.log causes error: "Synchronous XMLHttpRequest on the main thread is deprecated..." How to debug Spring Boot application with Eclipse? Unfortunately MyApp has stopped. How can I solve this? 500 internal server error, how to debug

Examples related to device

How to connect a Windows Mobile PDA to Windows 10 Xcode "Device Locked" When iPhone is unlocked How to determine the current iPhone/device model? How to set fake GPS location on IOS real device Android Studio doesn't see device How to detect iPhone 5 (widescreen devices)? iOS detect if user is on an iPad Why does adb return offline after the device string? How to detect a mobile device with JavaScript? Can't find android device using "adb devices" command

Examples related to adb

ADB server version (36) doesn't match this client (39) {Not using Genymotion} ADB device list is empty "unable to locate adb" using Android Studio Run react-native on android emulator Solving "adb server version doesn't match this client" error Adb install failure: INSTALL_CANCELED_BY_USER Session 'app': Error Installing APK Where is adb.exe in windows 10 located? How to debug in Android Studio using adb over WiFi Set adb vendor keys