DJ-DOO
DJ-DOO

Reputation: 4780

Android Studio starting in debug mode by default

I have been working on a project, and when I run the project in android studio it had been running correct and when I ran in debug mode it ran correctly.

All of a sudden, when I try to run the project normally, it pops up on the device waiting for debugger

and in the logcat I get this:

02-07 10:38:46.444    3968-3968/com.geog.test D/dalvikvm﹕ Late-enabling CheckJNI
02-07 10:38:46.784    3968-3968/com.geog.test W/ActivityThread﹕ Application com.geog.visitdub is waiting for the debugger on port 8100...
02-07 10:38:46.804    3968-3968/com.geog.test I/System.out﹕ Sending WAIT chunk

and it goes no further. I don't know why this is happening, there is no debug command in the manifest, I have killed the adb and restarted as I did with android studio.

It's a real pain in the a*** as I can't run the app without going through debug mode. If anyone has any ideas I'd like to hear them

Thanks

Upvotes: 33

Views: 19487

Answers (8)

Emre AYDIN
Emre AYDIN

Reputation: 734

I deleted the emulator and recreated. It worked for me.

Upvotes: 0

Arun Shankar
Arun Shankar

Reputation: 2593

In my case, there are multiple debuggers. I have native code running in my app.

I cleared it by selecting the Debugger and Process from Run->Attach Debugger to Process

Upvotes: 1

Mamatha G
Mamatha G

Reputation: 21

First clear all the break points from your project using ctrl+shift+F8 for windows or for mac cmd+shift+F8. Restart your android device. Then run

Upvotes: 2

Stefan Verhagen
Stefan Verhagen

Reputation: 303

In my case it was a service to which I had added android.os.Debug.waitForDebugger(). The service was in a separate process by defining in the manifest android:process=":sepprocess"; after removing this line (such that the service is in the same process as the main activity), debugging started to work in the service and I did not experience the

    I/System.out﹕ Sending WAIT chunk 

anymore.

Upvotes: 2

David Lord
David Lord

Reputation: 648

In my case, there was an AsyncTask whose doInBackground() method called android.os.Debug.waitForDebugger(), and this was being picked up even in run mode. Disabling the line fixed it. Restarting the device didn't help.

Upvotes: 3

mhdjazmati
mhdjazmati

Reputation: 4232

try this , always work :

1 - close Android Studio and any other IDE you have opened (maybe you have Eclipse also running?) and emulator instances;

2 - remove USB cable from PC and restart your phone if you use one ;

3 - run adb kill-server from console;

4 - open Android Studio;

5 - click on run/debug;

6 - when the window to select the device appears, attach your device to USB and USB to your computer;

Upvotes: 2

Carsten Svendsen
Carsten Svendsen

Reputation: 97

The above suggestions were too invasive for me so I digged a little more into it. The following solution works for me in android studio:

  • Start debugging. (You'll get the wait chunk message here)
  • Select the Debug pane with the bug icon.
  • press the small cross at the side menu.
  • press "Force close" on your device.
  • Restart debugging.

Upvotes: 5

Piyush Agarwal
Piyush Agarwal

Reputation: 25858

Restart your Android Device once and also check there should not be any breakpoints in your java classes.

Upvotes: 47

Related Questions