Search code examples
androiddebuggingbuildrelease

Why should I use a debug build?


I have a simple question:

Why should I use the debug configuration in Android Apps?

The reason for my question is that I ran into some release-only bugs which could be totally avoided if I always debug my code in the release variant.

So in the release build I just set the debuggable flag to true and disable ProGuard during debugging. -> Problem gone.

(I still have to test it once with ProGuard enabled of course...)

Are there any arguments against my approach? If not, why does a debug build exist then?

A collection of arguments for the debug variant according to other answers:

  • ProGuard (ok...this is no argument)
  • build speed (for some reason my release variant takes less time to compile...)
  • API-keys (one user more or less doesn't matter...)
  • debuggable (this also works in the release build)
  • debug-only permissions (I can uncomment this one line in the manifest...)
  • signing certificate (this doesn't really matter...)

Please give me something that makes me use the debug variant, otherwise I will ban it from my apps^^


Solution

  • In smaller projects a debug build can seem like an overkill. Like stated in the comments it is exactly the same as a release build when you turn of proguard and enable debugging. It's just a template for an Android project which allows you to quickly setup 2 types of builds.

    Once you work on bigger projects this functionality gets more interesting. You will set up a build server which triggers automated builds on a regular basis so you won't have to manually configure your gradle file each time you want a specific type of build. Next to debug and release you might even want to create more more configurations, each connecting to different test environments so testers can work without having to contact you each time they need a different build. You also mention the build times to be shorter on release but once your project gets big and you include e.g. Dexguard to obfuscate it will take a very long time each time you want to build and you'll love having debug builds to speed up your development