Reputation: 1477
We are trying to provide multiple environments to our end users and want to create one single bundle for both IOS and Android. Currently we have a hidden feature (clicking on the version number to open an environment selection screen: Dev, QA, UAT or Prod). However, I am wondering if there are better or recommended ways of achieving this same effect somehow.
Thanks!
Upvotes: 0
Views: 52
Reputation: 988
I can help you with Android on managing Environments using Gradle file.
Let's say you have a app with package name - com.company.sampleapp
In gradle your applicationId
will be com.company.sampleapp
Now we can create different flavors for different environment and we can also have different applicationId
as shown below.
android {
flavorDimensions "default"
productFlavors {
production {
dimension "default"
applicationId 'com.allegion.leopard'
}
//App will have package name appended with .qa
qa {
dimension "default"
applicationId 'com.allegion.leopard.qa'
}
//App will have package name appended with .dev
dev {
dimension "default"
applicationId 'com.allegion.leopard.dev'
}
}
}
Once this is done, you can choose build variants and create APK for that build. Added image for clarity
Hope this helps.
Upvotes: 0