"Waiting for debugger to attach" showing even when not running in debug mode
AndroidDebuggingAndroid Problem Overview
My problem:
I ran upon an awkward problem as I was developing my application. As mentioned in the title, every time I install my application (in run mode, not debug!) at start-up the waiting for debugger to connect.. message appears for 1-2-3 seconds, and the application starts.
What I want:
What I would like is to be able to start the application without that message appearing (it only started appearing in the last few days, and I can't remember changing anything related to debugging).
What I've tried:
- I have tried setting the
android:debuggable="false"
but if I do this the debugger never attaches and the message never disappears. - I have also tried after installing to disable
USB Debugging
, but still no results. - Even if I kill the application and wake it up through an external source (it uses Google's C2D Messaging Framework) it still tries to run in debug mode on wake-up.
I have developed several Android applications and never stumbled upon this. Why wouldn't I be able to start the application in RUN mode? Is there any other way to install the application on the device, without hitting the run button in Eclipse?
I can post code-snippets from the AndroidManifest or from other parts of the code if necessary, but as I already mentioned I wasn't getting this kind of weird behavior several days ago.
Android Solutions
Solution 1 - Android
Make sure your java files dont have any break point and Restart the device
every thing should be normal.
I was experience the same problems where my application was always being run in debug mode. Restarting the device did the trick for me.
and make sure you are using
right click on project-->>Run As -->> Android Application
Solution 2 - Android
For me the solution was turning off the USB debugging from my device settings, and then turning it on again!
Much quicker than restart the whole device.
Solution 3 - Android
I had the same problem using Android Studio. Restarting my cellphone worked for me!
Solution 4 - Android
1. Open setting in ur phone.
2. Go to developer options.(About Phone-> Developer Option).
3. Disable the Developer option and again enable the Developer Option.
4. Enable USB debugging and Install via USB.
Solution 5 - Android
Run this command and the issue will be resolved
adb shell am clear-debug-app
Solution 6 - Android
Check if the option waiting for debugger is actived.
Settings -> Developer options -> Wait for debugger.
I think this it is new from Jelly Bean.
Solution 7 - Android
I'm assuming this is in the emulator and not on a device. If it is a device, ignore the rest. :p
It sounds like you saved a snapshot of the emulator as the debugger was connecting.
To fix:
- Go to the AVD control panel, click on the emulator that's affected and hit start
- when the window pops up, de-select "Launch from snapshot" and leave "Save to Snapshot" selected
- Start the emulator.
- Close the emulator
- On the AVD control panel again start the emulator
- Check "Launch from snapshot" again
That should fix things up.
EDIT.
Sorry for the wasted space, I read too fast and missed you talking about trying disabling USB Debugging. I have run into the above situation I describe before so I'll leave this answer posted for those who come along who do have such an issue.
Solution 8 - Android
"Wait for debugger"in Developer options may have been set to wait your application.
Solution 9 - Android
Do check once that you placed breakpoints. Run app once and if you get the same message do debug as-> debug configuration-> select the app which you need to run and select always prompt to pick device.It will work for sure. It may be stupid, but i faced this problem for a long time and i tried this and this helped me. And if needed restart your device. Thanks
Solution 10 - Android
For me, I use Android Studio 2.1.2I, I click on Menu Run > Attach debugger to Android process There is only 2 lines __device_name ____app_name I just select app_name(want to run) and click OK then miracle happens.
Solution 11 - Android
I had the same problem. But restart my Device or clear the Breakpoints don't worked.
I tried : Run --> Attach to Android Process. Select your package and press OK.
and it works :)
Solution 12 - Android
There was so many adb processes running ,I kill them all and its start debugging
Solution 13 - Android
You can also set your Android App as Debugging-App Settings --> Developer Options --> set Debuging-App
there you can choice your app
Solution 14 - Android
Your manifest file may contain following permission
Just remove this permission
<uses-permission android:name="android.permission.SET_DEBUG_APP"/>