What is the practical way to install stable and development apps at the same time?

I want to keep a stable version of my app on my phone and continue developing ... which would put the app on my phone twice if there is a practical way to do this.

A search resulted in the guys doing what I was already looking at: rephasing the package name and possibly using a different icon file. Such ease, and tend to do something wrong or forget, etc.

Using Android Studio, is there anything a person could do in the build.gradle files or one of the other config files to make this work easy?

EDIT ---

So, from the suggestions below, I've added the following block for build.gradle above the defaultConfig block.

buildTypes {
    debug {
        versionNameSuffix ".DB"
        applicationIdSuffix ".debug"
    }
}

      

As for the fact that I have another icon to tell you about the crashes, for now I have added one single 72x72 icon variant to the res / drawable-hdpi folder. I have comments in my manifest file with icon names. I can just copy and paste in android: icon line to change icons.

+3


source to share


2 answers


Check out the gradle for a taste of the product . You can use a different package name in two different flavors, and then you can install both flavors on your phone at the same time. Note: Changing package names this way can lead to other tricks (for example, if you are using a Google Maps API key, you may need to allow package names to use the generated key explicitly).

You should be able to do the same package renaming in existing debug and release types, but I understand that you want both stable and advanced builds to be debug options.

Underlined code example from linked docs:



productFlavors {
    flavor1 {
        packageName "com.example.flavor1"
    }

    flavor2 {
        packageName "com.example.flavor2"
    }
}

      

If you go this route, be sure to read the "Build Type + Product Flavor = Build Variant" section in the linked docs. Gradle other materials that you should read for the full picture: applicationId

, packageNameSuffix

, applicationIdSuffix

.

+2


source


you can add to your buildTypes {}



 debug {
        versionNameSuffix "-DEBUG"
        applicationIdSuffix ".debug"
    }

      

+3


source







All Articles