85

It seems like every step I take in the Android world I run into problems.

Usually, I have my HTC Hero connected to the computer via USB and I launch the application either in debug mode or in normal mode.

So, the last time I ran the app in normal mode. Then I disconnect the device (I want to try to have it "free", not connected to computer) and I start the app from the menu. When I do that I get a popup saying "Application xxx is waiting for the debugger to attach" and there it stops and eventually dies.

Why is it waiting for the debugger, when the last time I ran the app (while connected) I didn't run it as Debug?

Edit 1

I might add this little weird fact:

If I do "Run" (green/white arrow) when the device is connected I still get a popup on the device saying "Application xxx is waiting for the debugger to attach".

Edit 2

Found this page. He restarted his device and that worked for me too. Stupid not to try that right away...

halfer
  • 18,701
  • 13
  • 79
  • 158
Ted
  • 18,194
  • 33
  • 89
  • 142

10 Answers10

157

Just to close this question: I restarted the device, and that helped.

Ted
  • 18,194
  • 33
  • 89
  • 142
  • 1
    Thanks, this was driving me nuts I was worried that I'd done something silly and didn't want to release until I was sure it wouldn't do that on my end user devices! – magritte Sep 23 '12 at 16:17
  • 1
    this is not perfect solution for reboot the device every time – Nitesh Khosla May 10 '13 at 07:00
45

For me, the solution is to select "None" in "Developer Options"->"Debug"->"Choose debug application", though it already has "None" selected. Seems like the device put a "need to debug" label on my app sometime before which is still there when I "Run" the app on the device using my IDE (or even launch the app manually when the device is not connected to PC), and re-select "None" removes the label. Don't know whether it's the case.

codeno
  • 461
  • 4
  • 4
  • Agreed, this should be tried before a reboot because it is likely the root of the problem – Zach Jul 14 '15 at 00:15
  • For me, unchecking the entire "Developer options" in Settings" solved the issue. It's so annoying to have the app asking all the time for attaching the debugger. Thanks! – YawaraNes May 17 '20 at 20:52
18

Restarting is more time taking, Easier way is that in the device, select "Developer Options" > “Select debug app” and select "Nothing".

Selfx Aadhyant
  • 355
  • 3
  • 8
5

Also, don't forget to go into your Android Settings under "Development Options" and unselect "Wait for Debugger"

Lars
  • 8,991
  • 3
  • 30
  • 35
  • Was about to add this answer but saw you posted. Did not scroll enough. This is what happened to me. Restarting did not help. This is the absolute right answer for me . – Jimmy May 17 '14 at 16:22
2

You could also try removing the android:debuggable="true" from your AndroidManifest.xml file when you want to test the application by itself. Turning off development options in the preferences menu will help also.

Austyn Mahoney
  • 11,078
  • 7
  • 59
  • 85
1

I assume you are using Eclipse. Are you sure you are pressing the green circle with a white arrow and not the green bug button? Try closing the project, reconnecting the Hero, open the project and click the green/white arrow.

With your Edit1 - Try uninstalling the application from the Hero and try again.

With you Edit2 - I believe that will turn off all debugging capabilities. Good luck.

fupsduck
  • 2,991
  • 17
  • 18
  • Hey, yes Im sure I am clicking on "Run" (green/white arrow). I will do some restarts and stuff =) – Ted Jan 08 '10 at 22:16
  • I also have a Hero so I know it works - but I do sometimes have to close/open my project and occasionally restart Eclipse. Hang in there - it takes a while getting used to Android. – fupsduck Jan 08 '10 at 22:19
  • Thx, it helped after rebooting my device for some reason =) – Ted Jan 08 '10 at 22:41
  • Uninstalling the application did not help in my case, only a device restart. Anyone have a clue as to why such a crude method is required to accomplish what seems like a routine task (install and run an app)? – Tomislav Nakic-Alfirevic Mar 22 '13 at 15:11
1

One more solution :)

In Android Studio 2.x follow these steps:-

1. Run the application:- Run Menu -> Run "app-name"

Image to check how to run application

2. Attach debugger to process:- Run Menu -> Attach debugger to Android Process Image to check how to attach debugger to process

0

"Wait for debugger"in Developer options may have been set with your application. Hence the application for debugger to attach.

Shinoo Goyal
  • 555
  • 7
  • 9
0

Turn off Developer option and turn it back on.

Vithu
  • 81
  • 7
0

Other than setting Select debug app to none, In android 9 and above (haven't check if exist in Android 8 but doesn't exist in Android 7) need to un-check Verify apps over USB

I recently upgraded my device from Android 7 to 9 and suddenly all my own apps (developed by me and are not signed) stopped working. disabling option mentioned above made them all work again.

AaA
  • 3,111
  • 8
  • 52
  • 77