I want to turn off the Crashlytics and Answers for my devices where I develop an app. E.g. attached mobile phone or virtual device. If it was plain java I would set java property. But Android Studio misses such feature. I can see there some install flags but they are not documented.
I found that I can detect running inside Firebase with the following condition
Settings.System.getString(getContentResolver(), "firebase.test.lab") != null
but I have no idea how to set it in Android Studio.
Update:
current code based on Max's answer is
insideFirebase = Settings.System.getString(getContentResolver(), "firebase.test.lab") != null;
if (!insideFirebase) {
CrashlyticsCore crashlyticsCore = new CrashlyticsCore.Builder().disabled(BuildConfig.DEBUG).build();
Crashlytics crashlyticsKit = new Crashlytics.Builder().core(crashlyticsCore).build();
if (BuildConfig.DEBUG) {
Fabric.with(this, crashlyticsKit);
} else {
Fabric.with(this, new Answers(), crashlyticsKit);
}
}