24

What kind of permission/Flag do I have to add to the manifest to debug my application on an actual Android device?

Janusz
  • 187,060
  • 113
  • 301
  • 369

3 Answers3

53

Add android:debuggable="true" to the <application> element

More info here.

Mark B
  • 183,023
  • 24
  • 297
  • 295
  • 3
    In ADT if you get a fatal error change it for a warning: Preferences->Lint Error Checking->Security section->HardCodedDebugMode et severity to warning. – Ed_ Jul 09 '14 at 21:49
3

You shold create a debug specific manifest file (typically in src/debug/AndroidManifest.xml). To avoid error: "Avoid hardcoding the debug mode." If you run/debug application directly throuh IDE, it is automatically build with android:debuggable="true" flag.

Wooff
  • 1,091
  • 12
  • 23
1

The issue is might be you have installed the live app which is not debuggable and you are overwriting with debuggable app. So, uninstall the app which is not debuggable and install your app. I will work. I tried this and worked for me.

Before trying this, make sure you are not in release build variant and in app->build.gradle debuggable true

Abish R
  • 1,537
  • 3
  • 18
  • 36