I can\'t attach Android Studio\'s debugger to my debuggable application process. Anyone else had this issue? Basically I can\'t get my app listed in Choose Process
In my case I just plug out and plug in cable from phone. Process was listed, and i was able to attach debugger
I solved this by going to a terminal and doing:
adb kill-server
adb start-server
Then I clicked in the "attach debugger" button and I could use it as normal
It could be because the release
build variant (which you can set in the Build-Variants
section) has been chosen mistakenly, only debug-variant
is debuggable
.
Hope this can be helpful to some friends.
same did happen with me, the root cause for this problem was interruption(network disconnection or force close) while updating any of the plugin(in my case kotlin) Solution For mac: goto prefrences(shortkey: cmd + ,)
For windows:(short key: **ctrl + alt + s)
or through menu
then in left panel look for Languages and Frameworks -> kotlin/java updaes and upon selecting it. In right pan there will be option(button) to update the plugin. update the plugin.
Exit and Restart the android studio. now you will be able to debug with all list of available processes running.
So finally I got it working, by:
Checking 'Show all processes' checkbox!
BUT as you see in the question, checkbox was on at the beginning, so there were multiple issues.
To summarize, these are other actions to be done:
adb
processes (use ps -x | grep adb
and kill -9 [process id]
)adb start-server
in terminaladb devices
(to make sure device is connected successfully)Android DDMS
Devices | logcat
shows your app and only one device is listed.Show all processes
checkbox. See screenshotI just encountered this one as well. I was pulling my hair out and did everything that was posted here. I thought I could add to the solutions here in case everyone had tried everything. I solve it via making my build variant debuggable.
So I made a PR and it was merged, unfortunately my debuggable flag on my own build variant was turned off when I pulled the source back, so I just have to turn it back on:
on your build.gradle file:
android {
...
buildTypes {
...
my_build_type {
minifyEnabled false
shrinkResources false
debuggable true // was false before
}
}
}
Also make sure that this build variant was set before you build your app to the device: