Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detect if the app is running on Google Play Pre-Launch report devices?

As I upload a new version of my app to Google Play I get a Pre-Launch testing report that's pretty nice and fine, but the issue is that most of the time the AI just wanders around the setup and does not test the actual UI. I'd like to pre-complete the setup quickly and randomly for those devices.

So my question is, is there a way to detect that it's running on those test devices?

like image 510
Avamander Avatar asked Mar 14 '17 22:03

Avamander


People also ask

What is pre launch report Google Play?

A pre-launch report is automatically generated when you publish an app to internal, closed, or open testing. It helps to identify issues proactively before your app reaches users. It includes tests for: Stability issues. Android compatibility issues.

How long does it take for Google Play to approve an app?

Once your app has been submitted to the Google Play Store it will be reviewed by a mix of Human and Automated auditors. This review process usually takes between 24 and 48 hours. A few hours after approval your app will appear on the Google Play Store.


2 Answers

You can detect a pre-launch test device with the following:

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

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

like image 156
Ryan R Avatar answered Sep 18 '22 22:09

Ryan R


In case anyone gets here looking for how to do this with React Native, check out the react-native-firebase package utils().isRunningInTestLab: https://rnfirebase.io/app/utils#test-lab.

like image 44
user161107 Avatar answered Sep 18 '22 22:09

user161107