I am trying to get application's debuggable attribute value from code:
packageInfo = context.getPackageManager().getPackageInfo(packageName, 0);
int flags = packageInfo.applicationInfo.flags;
isDebugMode = (flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0;
And I have noticed that when debuggable attribute is not specified in manifest this code defines it as true. And documentation says that it is false by default.
What's wrong?
The AndroidManifest. xml file contains information of your package, including components of the application such as activities, services, broadcast receivers, content providers etc.
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 insertandroid: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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With