Peter
Peter

Reputation: 11890

How to deal with various build types in Xamarin

I am moving my Android Studio project over to Xamarin.

Under Android Studio/Gradle, I can have multiple build types. For example, I can create alpha, beta, and release version of the same app:

buildTypes {
    release {
        minifyEnabled false
    }
    beta {
        applicationIdSuffix ".beta"
        debuggable true
    }
    alpha {
        applicationIdSuffix ".alpha"
     }
}

Gradle lets me modify the application id suffix so that I can install all the variations side by side on the same device.

I noticed that Xamarin lets you specify the package name from Visual Studio --> Project --> Properties --> Android Manifest. However, I need the package name to be different for various build types. How can I achieve this? Regards.

Upvotes: 3

Views: 1541

Answers (1)

jzeferino
jzeferino

Reputation: 7850

In Visual Studio you can create more Build Configurations.

You could create three Build Congurations (release, beta, alpha).

In each Build Configuration you could change the applicationId of the Android Application to match what you want. From this answer we can assume that applicationId is the same as the package name.

So, you could have 3 manifests and when you change the build config it will replace the correspondent manifest with the modified package name. Read this to learn how to this.

Upvotes: 3

Related Questions