Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 816
Abhi Avatar asked Dec 07 '10 10:12

Abhi


People also ask

How do I turn debug mode off?

To disable USB Debugging mode: Go to Settings and scroll to the System section (on Android 8 and above, go to Settings > System) Tap Developer Options. Tap the button to toggle developer options Off.

How do I wait for debugger?

Go to Settings > Developer options > Select debug app and choose your app from the list, then click Wait for debugger. Wait for the app to load and a dialog to appear telling you the app is waiting for a debugger.


2 Answers

Some devices will only let the debugger attach 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>  
like image 97
Iain Avatar answered Oct 27 '22 10:10

Iain


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

like image 29
Victor Mwenda Avatar answered Oct 27 '22 09:10

Victor Mwenda