Android Studio debugger has stopped working on devices (works on Genymotion though :P)

4,513 views
Skip to first unread message

Kaushik Gopal

unread,
Jun 18, 2014, 12:05:36 AM6/18/14
to adt...@googlegroups.com
Everything was working well. But recently (I'm guessing it's with the latest patch, but i'm not entirely sure of this) i noticed that i can't debug with my devices attached. I develop with the Genymotion emulator, and oddly i can debug/step-through there. But when i connect my actual device and try to attach the debugger, i get the dreaded "Waiting for debugger" alert. saying my application is waiting for the debugger to attach.


here are possibly useful bits of information:

-  on Android Studio 0.6.1 patch
- OSX Mavericks.

- Genymotion emulator works and allows debugging (no problems here).
- Actual devices don't and prompt aforementioned debugger alert.
- I have used these devices multiple times before, with previous versions, so i'm sure it's not an issue with the usb debug option on the phone etc.
- I can see the logs from the actual phone, on my Devices|logcat (like the radio signal/WifiState machine etc).
-  But nothing for my application. This leads me to believe "adb"  doesn't have a problem.
- Issuing the adb devices command successfully lists my device.

I've never had problems before and i've been using the latest builds from the last 15 releases of Android Studio. Usually when i've had problems like this, a simple restart of the device/Android studio solves it. This time nothing gives :(

Any help would be much appreciated! 

Kaushik Gopal

unread,
Jun 18, 2014, 12:07:56 AM6/18/14
to adt...@googlegroups.com
A small correction, I actually do see the log of commands within my app, on the device log cat (which is what makes it even more weird). It's just not clamping on to the app when running.

Siva Velusamy

unread,
Jun 18, 2014, 6:07:54 PM6/18/14
to adt...@googlegroups.com
When the app is waiting for the IDE to attach, what is the IDE doing? Did it go through the build fine, then install the apk, etc?

Also, Anything out of ordinary in idea.log? (Help | Show Log in Files)




--
You received this message because you are subscribed to the Google Groups "adt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adt-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kaushik Gopal

unread,
Jun 18, 2014, 8:24:03 PM6/18/14
to adt...@googlegroups.com
* it pops up the launcher for picking which device
* after picking the device, it appears that the apk is successfully installed onto the device. 
* It then pops up the alert saying "waiting for debugger" - Application is waiting for the debugger to attach.

Here are the logs from the debug console:
-------
Waiting for device.
Target device: samsung-nexus_s-12345ABCD
Uploading file
local path: <PATH TO MY PROJ_DIR/build/outputs/apk/app-debug.apk
remote path: /data/local/tmp/com.mycompany.app.debug
Installing com.mycompany.app.debug
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.mycompany.app.debug"
pkg: /data/local/tmp/com.mycompany.app.debug
Success


Launching application:com.mycompany.app.debug/com.mycompany.app.ui.activities.MainEntryPageActivity.
DEVICE SHELL COMMAND: am start -D -n "com.mycompany.app.debug/com.mycompany.app.ui.activities.MainEntryPageActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.mycompany.app.debug/com.mycompany.app.ui.activities.MainEntryPageActivity }

Warning: debug info can be unavailable. Please close other application using ADB: Monitor, DDMS, Eclipse
Restart ADB integration and try again
Waiting for process: com.micromobs.app.debug
----------

idea.log looks perfectly normal:

Marker - Jun 18, 2014, 5:19:32 PM
2014-06-18 17:20:03,383 [ 555159]   INFO - a.gradle.invoker.GradleInvoker - About to execute Gradle tasks: [:app:assembleDebug] 
2014-06-18 17:20:03,388 [ 555164]   INFO - s.plugins.gradle.GradleManager - Instructing gradle to use java from /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home 
2014-06-18 17:20:03,389 [ 555165]   INFO - dle.util.AndroidGradleSettings - Found Android SDK home at '/Applications/Android Studio.app/sdk' (from local.properties file) 
2014-06-18 17:20:03,389 [ 555165]   INFO - a.gradle.invoker.GradleInvoker - Build JVM args: [] 
2014-06-18 17:20:03,389 [ 555165]   INFO - a.gradle.invoker.GradleInvoker - Build command line options: [--configure-on-demand, -Pandroid.invoked.from.ide=true] 
2014-06-18 17:20:03,389 [ 555165]   INFO - .project.GradleExecutionHelper - Passing command-line args to Gradle Tooling API: [--configure-on-demand, -Pandroid.invoked.from.ide=true] 
2014-06-18 17:20:26,079 [ 577855]   INFO - indexing.UnindexedFilesUpdater - Indexable files iterated in 16 ms 
2014-06-18 17:20:26,079 [ 577855]   INFO - indexing.UnindexedFilesUpdater - Unindexed files update started: 0 files to update 
2014-06-18 17:20:26,079 [ 577855]   INFO - indexing.UnindexedFilesUpdater - Unindexed files update done in 0 ms 
2014-06-18 17:20:26,134 [ 577910]   INFO - indexing.UnindexedFilesUpdater - Indexable files iterated in 15 ms 
2014-06-18 17:20:26,134 [ 577910]   INFO - indexing.UnindexedFilesUpdater - Unindexed files update started: 0 files to update 
2014-06-18 17:20:26,135 [ 577911]   INFO - indexing.UnindexedFilesUpdater - Unindexed files update done in 1 ms 
2014-06-18 17:20:26,165 [ 577941]   INFO - indexing.UnindexedFilesUpdater - Indexable files iterated in 9 ms 
2014-06-18 17:20:26,165 [ 577941]   INFO - indexing.UnindexedFilesUpdater - Unindexed files update started: 1 files to update 
2014-06-18 17:20:26,171 [ 577947]   INFO - indexing.UnindexedFilesUpdater - Unindexed files update done in 6 ms 

----------------

Killing adb, restarting device, restarting app, restarting computer, none of that helps. I still can successfully debug, if i deploy to my emulator (Genymotion).

Thanks.



--
You received this message because you are subscribed to a topic in the Google Groups "adt-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adt-dev/M3Ui55RJ5Gc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adt-dev+u...@googlegroups.com.

Siva Velusamy

unread,
Jun 19, 2014, 12:09:31 PM6/19/14
to adt...@googlegroups.com
You shouldn't be seeing this warning:

Warning: debug info can be unavailable. Please close other application using ADB: Monitor, DDMS, Eclipse
Restart ADB integration and try again
Waiting for process: com.micromobs.app.debug

However, it is odd that you can still debug if using GenyMotion. Do you not see the same warning then? What I'd do:

1. Make sure "Tools | Android | Enable adb integration" is checked/enabled.
2. Close Studio.
3. Close any other tool (DDMS/monitor/..) that you might have running.
4. killall adb.

Restart and do the debug again. See if that warning still persists.

Kaushik Gopal

unread,
Jun 19, 2014, 7:18:11 PM6/19/14
to adt...@googlegroups.com
Hey! Thanks for looking into this.

> Do you not see the same warning then? 
Nope. When i run it through Genymotion, I don't see any warnings on the console and it goes through.

What I'd do:

1. Make sure "Tools | Android | Enable adb integration" is checked/enabled.
2. Close Studio.
3. Close any other tool (DDMS/monitor/..) that you might have running.
4. killall adb.

hmm. I just tried this but nothing seems to have changed. Are there any specific commands u have in mind that i should do to kill DDMS/monitor, adb  etc.? I currently don't run DDMs independently from Android Studio So i'm presuming there's nothing special i have to do, beyond just quitting Android Studio? For killing adb, i do the following:

    adb kill-server && adb start-server

----

I noticed that right at the end, when i successfully deploy to Genymotion, it says:

Connected to the target VM, address: 'localhost:8624', transport: 'socket'

Q: In the case of the device however, i get the message i posted previously. You think it could be a problem with Android Studio looking at a different port, than the one adb forwards my device to?

Siva Velusamy

unread,
Jun 19, 2014, 7:34:40 PM6/19/14
to adt...@googlegroups.com
Could we follow up on a bug? Please file one at b.android.com.

There should in theory be no distinction between an emulator and a device as far as initiating a debug connection goes. You can try a couple of other things:

1. Does the logcat tool window work fine? Does it show your application in the list of processes?
2. What happens if you run your app on the device, then click on "Attach debugger to Android process" toolbar icon? Does the process chooser show your process as running? Is it then able to connect properly?

From what I understand so far, it looks like Studio cannot determine the running debuggable processes on the device. (Make sure you are running your debug build, not release build).

Kaushik Gopal

unread,
Jun 19, 2014, 9:22:48 PM6/19/14
to adt...@googlegroups.com
1. Does the logcat tool window work fine? 

I believe so? If i hit "run" instead of debug, my application gets installed onto the device successfully, and I actually see custom logs from my app. If i run on debug mode, then it never enters my application, so i can't really say if the logs works or not.

>  Does it show your application in the list of processes?

I believe No. I'm not exactly sure though I understand exactly what you mean. I've attached a screenshot of what i see. I don't see my process listed on the left (which is what i think you're asking?). I do however see the processes listed on the drop down for filters (on the right).

2. What happens if you run your app on the device, then click on "Attach debugger to Android process" toolbar icon? Does the process chooser show your process as running? Is it then able to connect properly?

Ah, I remember one of the earlier versions of Android Studio had a similar issue (basically i would see the"waiting for debugger" icon), if i then went on to hit attach debugger to android process, it would work. Unfortunately that doesn't do anything with the release I currently have. If i hit the attach debugger toolbar icon, it pops up the window with my devices, but doesn't show my process (as seen in the screenshot). So i can't attach it to the process.

> Could we follow up on a bug?
Screen Shot 2014-06-19 at 5.51.38 PM.png
Screen Shot 2014-06-19 at 5.58.31 PM.png
Reply all
Reply to author
Forward
0 new messages