258

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

Zoe
  • 27,060
  • 21
  • 118
  • 148
Ondřej Z
  • 5,094
  • 3
  • 24
  • 30
  • Unplugging the device, and toggling off/on ADB integration fixes this, but this should be fixed within Android Studio! – Paschalis Dec 20 '16 at 19:44
  • 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...`. – S.R Sep 04 '17 at 18:25
  • Redmi Note 3 (lollipop) not able to do profiler for unknown reason, other device is ok though. – 林果皞 Oct 16 '17 at 07:48

17 Answers17

685

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

Auras
  • 7,556
  • 3
  • 25
  • 23
  • 35
    this is also helpful for regaining adb logging if u open up Device Monitor which steals it away – trippedout Feb 03 '15 at 21:19
  • 40
    if it is enabled already enabled disabling and re-enabling also solves it – Hadi Tok Apr 22 '15 at 11:01
  • 6
    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. – Sufian May 19 '15 at 10:55
  • 6
    Thanks! Something must have disabled this on me. It might have been Android Device Monitor. – Sam Jun 20 '15 at 04:31
  • @sam Seems like it could be Android Studio upgrade issue? I just opened an project made with 1.2 in 1.3 for the first time and this was disabled. Everything was fine the project I had open minutes before. – 13rac1 Aug 11 '15 at 01:20
  • 1
    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 http://stackoverflow.com/questions/32163302/androd-studio-doesnt-build-on-simulator-after-clean-install – whyoz Aug 23 '15 at 19:07
  • I specifically had this problem with my Nexus 5, running Android 6.0. "Enable ADB Integration" was active, and everything worked fine on my Oneplus One, running Android 5.1.1. What did solve it for me was setting debuggable true in the debug buildType (And then build the debug build variant ofc. :p) After that I was able to select it from the dropDown. `buildTypes { debug { debuggable true } }` – Spoetnic Nov 06 '15 at 09:42
  • this is one of the single most important fixes of every android developer. – Josh Dec 02 '15 at 10:26
55

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.

Teovald
  • 4,369
  • 4
  • 26
  • 45
Ondřej Z
  • 5,094
  • 3
  • 24
  • 30
  • 13
    You generally don't want to make your release build debuggable. It would be better to set the debuggable flag under the debug buildType – jb11 Feb 14 '15 at 03:26
  • 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. – arne.jans Mar 23 '15 at 16:11
33

Android Studio Tool bar

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.

A. Adam
  • 3,094
  • 1
  • 26
  • 25
11

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

Build Variants

lingyfh
  • 1,363
  • 18
  • 23
9

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

nlmm01
  • 871
  • 9
  • 12
  • 1
    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. – I'm_With_Stupid Mar 08 '17 at 23:25
7

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

Kushal
  • 8,100
  • 9
  • 63
  • 82
7

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

Ojonugwa Jude Ochalifu
  • 26,627
  • 26
  • 120
  • 132
1

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.

AlDroid
  • 45
  • 1
  • 8
1

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.

Anish Mittal
  • 1,157
  • 12
  • 29
1

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.

Kurt Van den Branden
  • 11,995
  • 10
  • 76
  • 85
SaidTagnit
  • 115
  • 3
  • 14
1

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

Otaroid
  • 11
  • 1
  • 1
    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. – Vince Bowdren Aug 18 '16 at 11:10
1

This is the problem I encountered.The AAR file you import may change the attribute of debuggable, So just remove the debuggable attribute in your Main App Manifest file. See the picture:enter image description here

Enaoi
  • 449
  • 4
  • 6
1

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

enter image description here

2.If it says application not debuggable then alter gradle

enter image description here

  1. Repeat step 1

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

enter image description here

5.Restart adb server

enter image description here

6.Dis connect and connect device It will list

enter image description here

Vinayak
  • 6,056
  • 1
  • 32
  • 30
1

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 !

Muhammad Naderi
  • 3,090
  • 3
  • 24
  • 37
  • Did you found any solution to make Persian calendar and AndroidStudio work together? – Homayoon Ahmadi Dec 12 '21 at 17:10
  • Not yet ... perhaps we should open an issue for Jetbrains? – Muhammad Naderi Dec 13 '21 at 08:01
  • 1
    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. – Homayoon Ahmadi Dec 13 '21 at 08:36
  • 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 ! – Homayoon Ahmadi Dec 13 '21 at 08:38
  • 1
    But I also think we have to open an issue for JetBrains to solve this for next releases. – Homayoon Ahmadi Dec 13 '21 at 08:41
0

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'

enter image description here

Eddie Martinez
  • 13,582
  • 13
  • 81
  • 106
0

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

frankelot
  • 13,666
  • 16
  • 54
  • 89
0

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.