What is the android debuggable default value
android:debuggable
Whether or not the application can be debugged, even when running on a device in user mode — "true" if it can be, and "false" if not. The default value is "false".
No mention of difference in API level, so min/target SDK versions of your app should not matter.
Android 'debuggable' default value
From SDK Tools : ( SDK Tools, Revision 8 (December 2010) )
Support for a true debug build.
Developers no longer need to add the
android:debuggable
attribute to the
<application>
tag in the manifest —
the build tools add the attribute automatically. In Eclipse/ADT, all
incremental builds are assumed to be
debug builds, so the tools insert
android:debuggable="true"
. When
exporting a signed release build,
the tools do not add the attribute.
In Ant, aant debug
command
automatically inserts the
android:debuggable="true" attribute,
whileant release
does not. If android:debuggable="true" is manually
set, thenant release
will actually do
a debug build, rather than a release
build.
Why is an Android app not debuggable by default?
This following post explains it well do not use debugabble attribute
Here are the important notes from it.
There were a time when the Android developer had to take care of updating the debuggable attribute of his app's manifest file, setting it to "true" for debugging, and for "false" just before releasing a new signed package.
But that time passed by on December, 2010. Although not every developer had noticed it, so many of them continue manually doing the debuggable switching.
http://developer.android.com/tools/sdk/tools-notes.html
From SDK Tools revision 8:
Support for a true debug build. Developers no longer need to add the android:debuggable attribute to the tag in the manifest — the build tools add the attribute automatically. In Eclipse/ADT, all incremental builds are assumed to be debug builds, so the tools insert android:debuggable="true". When exporting a signed release build, the tools do not add the attribute. In Ant, a ant debug command automatically inserts the android:debuggable="true" attribute, while ant release does not. Ifandroid:debuggable="true" is manually set, then ant release will actually do a debug build, rather than a release build.
So, the best thing you can do in most of the cases is not to deal with the attribute at all, since that way you will be sure that when you are exporting a signed release it won't include debug data.
The only exception is if you actually need to distribute a signed package with debug information included, not a common case indeed...
If debugable is set to false or true it changes nothing
The answer to this very question is already given on SO.
See Android 'debuggable' default value.
Get android manifest application debuggable property value
You check if DEBUGGABLE is true or false using this
(getContext().getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0
Getting debuggable value of androidManifest from code?
Use PackageManager
to get an ApplicationInfo
object on your application, and check the flags
field for FLAG_DEBUGGABLE
.
boolean isDebuggable = (0 != (getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE));
How can I detect whether an Android APK has debuggable set to true or false in its manifest without installing it?
This is one of those "easy once you know how" things - Use the aapt tool to inspect the manifest.
aapt dump xmltree YourApp.apk AndroidManifest.xml | grep debuggable
That command will give you a dump of the compiled form of the AndroidManifest.xml file- the output will look something like
A: android:debuggable(0x0101000f)=(type 0x12)0x0
(Actual output from my command prompt) in that example, the 0x0 indicates false.
Gradle release build still debuggable?
Viewing logcat is not tied to whether the app is debuggable or not.
If you see the process in DDMS then your app is debuggable (unless you're looking at an emulator in which case all apps are considered debuggable).
Related Topics
Get Bluetooth Local MAC Address in Marshmallow
Android - Google Play Like Tabs
How to Retrieve More Than 1000 Rows from Parse.Com
Android Drag/Animation of Views
How to Get National Holidays of Selected Country
Post on Facebook Wall Using Facebook Android Sdk Without Opening Dialog Box
Outdated Kotlin Runtime Warning in Android Studio
Android Set Custom Font to a Paint
"No Enclosing Instance of Type" Error While Calling Method from Another Class in Android
Android - Nestedscrollview Which Contains Expandablelistview Doesn't Scroll When Expanded
How to Parse the CSV File in Android Application
Masked Input Using Edittext Widget in Android
Transfer Data from One Activity to Another Activity Using Intents
Android:Understanding Drawable Folder
Loading an Android Resource into a Webview
Save Internal File in My Own Internal Folder in Android
Android Opening a File with Action_Get_Content Results into Different Uri'S