Application is waiting for the debugger to attach

AndroidEclipse

Android Problem Overview


I,m working in eclipse to develop an android app and when i tried to debugged on my samsung tab, i got the following msg on its screen "Waiting for debugger" and beneath it was written "application xxx is waiting for the debugger to attach ", I did some search and found to:

  1. See target sdk

  2. Restart eclipse and device

  3. Update eclipse

  4. Uninstall app from device and install again

    I tried all this, but nothing helped. Kindly help me.

Android Solutions


Solution 1 - Android

In my Nexus 7 Tablet running android 4.4.2 I solved this problem by going into

  1. Settings
  2. Developer options
  3. Select Debug app
  4. was selected , Select Nothing

Done!

Solution 2 - Android

Sometimes "force to close and open again" doesn´t work, so this problem could be present when the application is currently in debug and is selected to be debugged, then from your device go to:

Settings -> Developer options -> Select app to be debugged -> Select Nothing

or when the application is supossed to being in "debug mode" but is not selected as be debugged :

Settings -> Developer options -> Select app to be debugged -> Select the application!

Solution 3 - Android

I had same issue. Adding permission didn't help me, because Eclipse automatically enables debugging when it runs in debug mode.

Check your device setting whether "Wait for debugger" is unchecked under "Developer Options".

Also I tried closing and restarting Eclipse, and finally it worked!

I'm still figuring out what the real problem is, but hope this helps!

Solution 4 - Android

Restarting Eclipse is the only solution which works every time for me.

Solution 5 - Android

Go to Settings->Developer options. And then just turn off and on check box right to the Developer options title.

Also toggle USB Debugging again.

Worked for me

Solution 6 - Android

I was having same problem with my emulator. What i did is,

  1. Close the emulator

  2. Open AVD manager

  3. Wipe Data from dropdown for the required emulator in AVD Manager. May be same thing work for devices also.

Solution 7 - Android

This has been asked before. It is uncommon, but some devices need an extra permission(flag) to let the debugger attach!

So open your androidManifest.xml and add this permission:

<uses-permission android:name="android.permission.SET_DEBUG_APP"></uses-permission>

Solution 8 - Android

Another reason for this dialog to hang there is when you have breakpoints in different processes of your components (application / activity etc...).

For example:
If you have a breakpoint in an activity that runs on a different process than your main application you will see this dialog until you attach the debugger to the process manually.
For android studio it will be using the icon in the middle:

enter image description here

The intuitive reason for this will be that when you run in a debug mode the debugger is attached to your main application process and not to all your other processes, thus you need to specify manually to which process you want to attach your debugger.

Solution 9 - Android

I had this problem when I press only F11 to Run.

Pressing F11 does debug. In order to run, press Ctrl+F11.

I haven't ever seen this problem after do like this.

Solution 10 - Android

I ran into this issue on Android Studio 2.0 with a Nexus 6 running 6.0.1.

I tried most of the suggestions above and finally fixed it by restarting both Android Studio and my Nexus 6.

Solution 11 - Android

I had this same issue and eventually found that in AndroidManifest.xml the Application element had the following attribute:

 android:debuggable="false"

I changed this to

 android:debuggable="true" 

And the debugging then worked correctly.

Solution 12 - Android

I had the same problem with my Samsung S4 mini: after hibernating my pc with running eclipse, my phone couldn't connect with the debugger anymore. Restarting phone and eclipse didn't work.

I found, that my eclipse "disabled" the debugger in the android devices view: Window menu -> Show View -> Other -> Android -> Devices (also called DDMS view)

There was a red bug in front of my device. I enabled debugging by pushing the green bug button and now debugging works fine. This also works, if there is no bug in front of your debugging device.

Solution 13 - Android

It's also good to investigate port 8700 (the DDMS "base port", a port forwarder). When TCPView shows that this port is kept by process "", it's impossible to connect to ADB and debug. This process can't be killed nor terminated in TCPView. After logging out of Windows and logging in again, this port is free again. After starting AndroidStudio/IntelliJIdea this port is owned by process "idea64.exe" and its possible to debug.

When application crashes and AndroidStudio is restarted without stopping debugger (which also detaches from ADB), it may happen that port 8700 is not released, blocked by process "".

TCPView: https://technet.microsoft.com/en-us/library/bb897437.aspx http://developer.android.com/tools/debugging/ddms.html

Solution 14 - Android

I got this error even when the USB was unplugged, and the app wouldn't start.

The only thing that worked for me was restarting the Android device.

Solution 15 - Android

I found this simple solution to it. Just click on the debug panel tab at the lower potion of your eclipse or wherever it is. Tada!! It works! It seems eclipse is getting old it needs a slight nudge. Works every time for me!

Solution 16 - Android

I got stuck with this when I tried to debug from IntelliJ cause I had both IntelliJ and Android Studio open. Even if there where no debug-process going on in Android Studio, I was able to launch debug from IntelliJ after I closed Android Studio.

Solution 17 - Android

Restarted the Android Studio but that didn't help. Unplugged the device from USB and plugged it back in which did the trick for me, no changes needed in Developer options in the phone settings.

Solution 18 - Android

I have tried the following to no avail:

  • Restart the Android device.
  • Turn Developer options off/on under the Settings of the Android device.
  • Disable/enable USB debugging.
  • Restart Android Studio.

It started working after: Android Studio > File > Invalidate Caches/Restart...

Solution 19 - Android

For me it was when two different Android Studio were launched simultaneously

Solution 20 - Android

It's normal message when you debugging your application. Just wait for several seconds and app will start.

Solution 21 - Android

Simply force to close then, open it again :)

Edited: force to close the application, and then go to menu and start the application by clicking on the apps icon

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionsaadsafView Question on Stackoverflow
Solution 1 - Androidsilver1991View Answer on Stackoverflow
Solution 2 - AndroidJorgesysView Answer on Stackoverflow
Solution 3 - AndroidNari Kim ShinView Answer on Stackoverflow
Solution 4 - AndroidRegis_AGView Answer on Stackoverflow
Solution 5 - Androidvbevans94View Answer on Stackoverflow
Solution 6 - AndroidMandeep SinghView Answer on Stackoverflow
Solution 7 - AndroidbofredoView Answer on Stackoverflow
Solution 8 - AndroidMikeLView Answer on Stackoverflow
Solution 9 - AndroidHyeonjin JungView Answer on Stackoverflow
Solution 10 - AndroidjosefView Answer on Stackoverflow
Solution 11 - AndroidBruceHillView Answer on Stackoverflow
Solution 12 - AndroidpartisanView Answer on Stackoverflow
Solution 13 - AndroidgreenmarkerView Answer on Stackoverflow
Solution 14 - Androidlive-loveView Answer on Stackoverflow
Solution 15 - AndroidUtsav GuptaView Answer on Stackoverflow
Solution 16 - AndroidsuperoddeView Answer on Stackoverflow
Solution 17 - Androidtariq101View Answer on Stackoverflow
Solution 18 - AndroidHongView Answer on Stackoverflow
Solution 19 - AndroidVladimir BerezkinView Answer on Stackoverflow
Solution 20 - AndroidAutocrabView Answer on Stackoverflow
Solution 21 - AndroidOotviaView Answer on Stackoverflow