Android.util.Config.DEBUG is always false even when developing and debugging in an eclipse. What for?

When developing in eclipse, the constant android.util.Config.DEBUG is always incorrect, even when I am debugging a project.

javadoc for this constant says that "if it's a debug build, this field will be true." What am I doing wrong?

+4
source share
2 answers

The "string" mentioned in the document is not your build of applications, but the Android system.

The value of Config.DEBUG ONLY depends on the system (ROM) of your device, nothing to do with your application. On a device with a production assembly, ROM Config.DEBUG is always mistaken, regardless of how you install USB debugging on the device and the debugged flag in the manifest.

If the document is written like this: "If the Android system is a debug assembly, this field will be true." Then it will be less confusing.

+6
source

http://groups.google.com/group/android-developers/browse_thread/thread/be329298953aa8bd

I think that, given the link above, the answer lies with the device, not just your application.

Have you entered your device settings and enabled debugging?

Go to "Settings"> "Application Settings"> "Development" and make sure that USB debugging is enabled.

[Edit] And make sure that you set debuggable = "true" in your manifest file

<manifest> ... <application android:debuggable="true" > 
0
source

Source: https://habr.com/ru/post/1332853/


All Articles