Reputation: 38988
Similar to this question, how can I have two app entries in Crashlytics - one that reports production issues and another for regression testing or even beta testing issues?
Upvotes: 4
Views: 1668
Reputation: 3
You can simply change your package name like this https://stackoverflow.com/a/27677033/8769539 or you can add environment.gradle in your app and add this code
ext.ENV_PROD = '"PROD"'
ext.ENV_DEV = '"DEV"'
ext.PACKAGE_DEV = 'your dev package name'
ext.PACKAGE_PROD = 'your prod package name'
ext.ENV = ENV_PROD // modify
ext.PACKAGE = PACKAGE_PROD // modify
def propsFile = rootProject.file('urls.properties')
if (propsFile.exists()) {
def props = new Properties()
props.load(new FileInputStream(propsFile))
if (ENV.equals(ENV_PROD)) {
PACKAGE = PACKAGE_PROD
}
}
then apply it to build.gradle like this
`apply from: 'environment.gradle`
Upvotes: 0
Reputation: 16364
You can specify different version strings for different versions of your app, and Crashlytics will track them seperately.
For the production version,
Crashlytics.setString("version", "Production");
For your testing version,
Crashlytics.setString("version", "Testing");
Similarly, you can have as many versions as you want.
And then, on the top left corner of your Crashlytics dashboard, you can click on the dropdown to select the version you want to view.
Upvotes: 6