Android — Keeping Release and Debug Installed All the Time
I think a lot of Android developers use their daily-driver phone as a developer device. I know I do. This leads into a side effect: you can only have your debug build you’re working on or the production version from Google Play installed the same time. They both have the same app ID but are signed with a different signature. If you want to switch between production and debug it means uninstallations in between.

You should always have the production build of your app installed and not uninstall it to run debug. This helps you to catch issues like database creeping in size or strange update conditions you might otherwise miss. If you always run your app from a fresh install you won’t be on the same page with your users.

Keeping both installed

Fortunately, solving the above issue is easy. Let me explain how I do it in my hobby projects and customer projects. If you feel that this is not the best way to go by it, leave a comment or ping me on Twitter to explain your solution.

Separate debug app ID

Your app ID is defined in the app gradle file generated by Android Studio when you started your app.

This in the app module gradle file

You will want to keep the release app ID the most descriptive and least cluttered as it is visible to the users as part of your Play Store URL. So what you want to do is to make the debug build separate. Gradle allows us to do this nicely:

Add the above debug {applicationIdSuffix “.debug”} part to the same app module gradle file.

You now have the minimum viable solution to the problem. You can install the debug build next to your production into your phone.

Telling them apart

Having 2 app icons with the same name isn’t really very helpful. You need to be able to tell them apart and figure out which is which.

Android build variants to the rescue!
['Juhani Lehtimäki']
['Gradle', 'Story', 'App Development', 'Debug', 'Android']