【问题标题】:How to detect if the app is running on Google Play Pre-Launch report devices?如何检测应用程序是否在 Google Play 发布前报告设备上运行?
【发布时间】:2017-03-14 22:06:42
【问题描述】:

当我将我的应用的新版本上传到 Google Play 时,我得到了一份非常不错的发布前测试报告,但问题是大部分时间 AI 只是在设置中徘徊,并没有测试实际的用户界面。我想快速、随机地为这些设备预先完成设置。

所以我的问题是,有没有办法检测它是否在那些测试设备上运行?

【问题讨论】:

    标签: android testing google-play


    【解决方案1】:

    您可以通过以下方式检测预发布测试设备:

    private boolean isTestDevice() {  
      String testLabSetting = Settings.System.getString(getContentResolver(), "firebase.test.lab");
      return "true".equals(testLabSetting);
    }
    

    见: https://firebase.google.com/docs/test-lab/android/android-studio#modify_instrumented_test_behavior_for

    【讨论】:

    • Firebase 的测试实验室是否与 Google 发布前报告完全一样?
    • 很确定,但我自己没有测试过。我将很快在生产中测试此代码。我会回来报告...
    • 我对此进行了测试,它检测到了测试设备。
    • 它确实有效,但我发现 Firebase Analytics 仍会记录 first_openscreen_viewsession_start 事件。从那里开始,测试将停止工作。有什么方法可以防止这种情况发生吗?它让我的 Firebase 报告变得“脏”。
    • @xarlymg89 您是否找到了避免 first_open 等在测试运行时的解决方案?
    【解决方案2】:

    如果有人来这里寻找如何使用 React Native 执行此操作,请查看 react-native-firebase 包 utils().isRunningInTestLab:https://rnfirebase.io/app/utils#test-lab

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-02-27
      • 2019-09-01
      • 1970-01-01
      • 2011-09-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多