Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to build a debug android apk so BuildConfig.DEBUG is true?

There are places in the code I use the flag BuildConfig.DEBUG, where can I set this flag and how can I make a debug android apk so BuildConfig.DEBUG is true?

like image 236
s-hunter Avatar asked Jun 02 '26 04:06

s-hunter


2 Answers

where can I set this flag

It is set for you automatically when you create a debug build. You can use the Build Variants view in Android Studio to choose what build is used when you run your app from the IDE.

If you create custom build types, you can use debuggable true to mark them as debuggable, and they will have BuildConfig.DEBUG set to true as well.

like image 163
CommonsWare Avatar answered Jun 03 '26 19:06

CommonsWare


When you run your project in Android Studio. The apk that it install in your testing device is the debug apk. You can find the apk in

YourApplication\app\build\outputs\apk

like image 44
Amit Shekhar Avatar answered Jun 03 '26 18:06

Amit Shekhar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!