ChatGPT解决这个技术问题 Extra ChatGPT

Android Studio - no debuggable applications

I tried to debug a release version of my Android application but Android Studio failed to attach a debugger. (It could not find Android procces of my running application).

Under devices console, there was only a message:

No debuggable applications

Unplugging the device, and toggling off/on ADB integration fixes this, but this should be fixed within Android Studio!
This is not mentioned in below answers, So After making sure ADB Integration is enabled and still got the problem, before you go for below answers, first try the simplest one: Invalidate Caches / Restart....
Redmi Note 3 (lollipop) not able to do profiler for unknown reason, other device is ok though.

A
Auras

You also should have Tools->Android->Enable ADB Integration active.


this is also helpful for regaining adb logging if u open up Device Monitor which steals it away
if it is enabled already enabled disabling and re-enabling also solves it
It is also important to note that you aren't running another IDE such as Eclipse. If you are, you might need to restart AS after you have closed Eclipse.
Thanks! Something must have disabled this on me. It might have been Android Device Monitor.
this is now default in the current Android Studio 1.3x release, and it doesn't even get close to the solution in my case..if this didn't help you, check out this wiki stackoverflow.com/questions/32163302/…
T
Teovald

The solution is to turn on debuggable flag (debuggable true) in application's gradle file:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 19
    buildToolsVersion "20.0.0"

    defaultConfig {
        applicationId "org.example"
        minSdkVersion 14
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }

    buildTypes {
        debug {
            debuggable true
        }
    }
}

After Android Studio synced Gradle with project files and reinstalled an application, the debugging start working.


You generally don't want to make your release build debuggable. It would be better to set the debuggable flag under the debug buildType
I don't unterstand, it used to work without this with Android Studio V1.1 and before, but since V1.2 it doesn't work anymore. So thanks for your tip! Thanks for you, too, @jb11 for recommendation about the buildType debug.
A
A. Adam

https://i.stack.imgur.com/Gxiur.png

Just click the "Bug" icon and you will be good to go.

I had the same problem and that did the trick. hope it helps someone.


For some magical reason I was not able to turn ADB integration on, and this worked.
l
lingyfh

if intellij or AS you should make sure your Build Variants Setting is debug.

https://i.stack.imgur.com/eZD2X.png


n
nlmm01

Check if Tools->Android->Enable ADB Integration is enabled. Also disable and re-enabling it works most of the times.


Disabling and re-enabling it worked perfectly for me since it had already been enabled, but hadn't been working since I last updated Android Studio.
K
Kushal

I want to add one point to above 2 answers :

If Eclipse IDE is running parallel to Android Studio then above answers may not help you. The debuggable application will not refresh event after setting debuggable true in Gradle file.

So, close Eclipse IDE and check in Android Studio. The debuggable application will refresh.

Thank you


Or it can be 2 instances of Android Studio too. Need to make sure only one is running.
O
Ojonugwa Jude Ochalifu

Believe it or not,a faulty USB cable can cause this problem to linger even if you follow all the suggestions here.Changing my USB cord did it for me


yep, also you can try to unplug & plug in to another usb port your device
A
AlDroid

It happen to me when I wanted to debug my app after I Generated a Sign APK, so I had to change back the Build Variants value from release to debug.


A
Anish Mittal

Multiple Options to do this:

1.Tools->Android->Enable ADB Integration

OR

2.Build->Clean Project , the Build-> Rebuild Project. Then "adb kill-server" and "adb start-server"

One of above will work.


K
Kurt Van den Branden

You should check also in your AndroidManifest.xml file that there is no option like android:debuggable="false" in your application tag.

<application
        android:icon="@drawable/icon"
        android:label="@string/app_name"
        android:debuggable="false">

To make it work just remove this option.


O
Otaroid

Ctrl+shift+A Type Enable ADB Integration click on toggle Done


Hi Otaroid, and welcome to Stack Overlow. Remember that you are answering an old question, so the original question's author has probably long ago solved their problem one way or another. For your answer to be useful, it should be a good answer for other readers searching the site for solutions to similar problems; so I recommend adding a lot more explanation and detail, perhaps with links to official documentation, to really justify why this technique is the best solution to this kind of problem.
E
Enaoi

https://i.stack.imgur.com/TObXt.png


V
Vinayak

Working solution

1.For testing run as debug if everything is correct process is attached and you can able to debug.Can see in the list

https://i.stack.imgur.com/UqsUT.png

2.If it says application not debuggable then alter gradle

https://i.stack.imgur.com/wB3c1.png

Repeat step 1

4 .If not toggle Tools->Android->Enable ADB Integration and make it enabled.

https://i.stack.imgur.com/DhNtR.png

5.Restart adb server

https://i.stack.imgur.com/TSUpD.png

6.Dis connect and connect device It will list

https://i.stack.imgur.com/wgWUI.png


M
Muhammad Naderi

Believe it or not, if you are on Windows OS, region setting has something to do with this too.

make sure your Regional Format is on English (United States) or actually any setting which makes your Calendar non-unicode (e.g. not On Persian Calendar or Arabic ...)

Apparently someone in Android Studio or ADB Dev team used .toString() with no respect to culture somewhere in their code !


Did you found any solution to make Persian calendar and AndroidStudio work together?
Not yet ... perhaps we should open an issue for Jetbrains?
I solved the problem. I backed up regional settings from regedit with en-US and fa-IR settings applied. Then I wrote a batch file that runs 3 commands: 1. Change the registry to en-US settings; 2. Run Android Studio studio64.exe file and 3. Restore settings to fa-IR regional settings.
Then in AS shortcut I open that batch file instead of opening studio64.exe. It opens a cmd window and do the trick for me and closes immediately. Thats it !
But I also think we have to open an issue for JetBrains to solve this for next releases.
E
Eduardo Dennis

Click the green bug, but make sure the drop down is set to app, if not it will not deploy your app, and just say something about.

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

https://i.stack.imgur.com/Uprr8.png


f
frankelot

Make sure your build variant is set to "debug". And debug has debuggable true on your build.gradle file


佚名

I used Mac to run Android Studio. I agree with @Kushal, I did not open Eclipse though. I shut off Parallels Desktop and other APPs which may use the same Gradle.