Reputation: 1367
I can't debug any of my applications on my emulator, they all hang at "Application... is waiting for the debugger to attach. This wasn't a problem before. I have tried to debug apps that I programmed months ago and even those fail to be attached to the debugger.
I have searched around and found common solutions to this problem such as: Using permission "android.permission.SET_DEBUG_APP" and having the application tag android:debuggable="true" found in this question Attaching debugger - android problem but after checking, found my apps already have these settings set.
I have also made sure 'USB debugging' setting is checked under Settings>Applications>Development. I also always check new updates for eclipse. I think I started having this problem after an eclipse update. Has anyone found a solution to this issue? I have been working on a really cool app and been able to create the UI, but really need to be able to debug as I will be implementing things I haven't before and no debugging would be a major set back and slow me down.
Upvotes: 0
Views: 3805
Reputation: 805
Try making sure your Threads pane isn't displaying. As @arcadoss metioned the debugger needs to be idle for a period of time, and the threads pane constantly refreshes the threads in its view.
Upvotes: 0
Reputation: 33
According to android sources os will sit and spin in infinite loop until debugger idle long enough. You could force debugger to idle by pressing pause debug button, waiting 1,5 sec and pressing resume. After that debugger should attach.
/*
* There is no "ready to go" signal from the debugger, and we're
* not allowed to suspend ourselves -- the debugger expects us to
* be running happily, and gets confused if we aren't. We need to
* allow the debugger a chance to set breakpoints before we start
* running again.
*
* Sit and spin until the debugger has been idle for a short while.
*/
while (true) {
long delta = VMDebug.lastDebuggerActivity();
if (delta < 0) {
System.out.println("debugger detached?");
break;
}
if (delta < MIN_DEBUGGER_IDLE) {
System.out.println("waiting for debugger to settle...");
try { Thread.sleep(SPIN_DELAY); }
catch (InterruptedException ie) {}
} else {
System.out.println("debugger has settled (" + delta + ")");
break;
}
}
Upvotes: 0
Reputation: 12527
I have had this problem lately since Android tools 15. The workaround I found is to lanch the emulator before you launch eclipse. Then it seems to work fine.
Upvotes: 2