How to detect running in Firebase Test Lab

后端 未结 2 1531
旧巷少年郎
旧巷少年郎 2020-12-11 16:18

I\'ve discovered a problem recently with my app\'s setup in Firebase. We have the pre-launch report configured, which means that the test lab devices are contributing a larg

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-11 17:04

    This is actually mentioned in the docs.

    You can check for the existence of a system property called "firebase.test.lab":

    @Nullable String testLabSetting =
      Settings.System.getString(context.getContentResolver(), "firebase.test.lab");
    if ("true".equals(testLabSetting)) {
      // Do something when running in Test Lab
    }
    

提交回复
热议问题