J'ai trouvé un bon article ici: http://tekeye.biz/2013/android-debug-vs-release-build.
Également testé. Si l'on force android:debuggable="false"
ou android:debuggable="true"
sur demande Manifest, il avertit:
Avoid hardcoding the debug mode; leaving it out allows debug and release builds to automatically assign one less...
It's best to leave out the android:debuggable attribute from the manifest. If you do, then the tools will automatically insert android:debuggable=true when building an APK to debug on an emulator or device. And when you perform a release build, such as Exporting APK, it will automatically set it to false.
If on the other hand you specify a specific value in the manifest file, then the tools will always use it. This can lead to accidentally publishing your app with debug information.
Je terminerai, dans la situation par défaut ApplicationInfo.FLAG_DEBUGGABLE
se comporter comme BuildConfig.DEBUG
, sauf dérogation en changeant android:debuggable
, ce qui est pas quelque chose souhaitable.
Comparer à BuildConfig.DEBUG
, ApplicationInfo.FLAG_DEBUGGABLE
est un moyen de vérifier pour version de débogage plus fiable, au module dépendant inférieur, il ne peut pas accéder au BuildConfig.DEBUG
du module parent, et pourrait avoir une valeur différente.
par exemple. App utiliser le module MyLib. Le BuildConfig.DEBUG
de l'application peut être faux, mais MyLib BuildConfig.DEBUG
peut être vrai. D'où il est préférable de vérifier en utilisant ApplicationInfo.FLAG_DEBUGGABLE
À quoi sert Debug où Debuggable est faux? – Elye
Je ne peux pas rappeler un tel cas, désolé. – azizbekian