How can I tell if my Android app is running in Google Cloud Test Lab?

354 Views Asked by At

I'd like to be able to skip the login screen and disable analytics tracking in my app when running monkey runner tests on Google Cloud Test Lab.

The Best Practices for Cloud Test Lab page states:

Digital advertising providers can filter ad revenues and all corresponding traffic generated from Cloud Test Lab by filtering traffic originating from the following range of IP addresses: 108.177.6.0.x - 108.177.6.24.x

However when I check the IP address when running on Cloud Test Lab (using this code) I'm returned an IP address in the range 10.10.[193-202].x.

Is there another way of determining if your app is running in Cloud Test Lab?

2

There are 2 best solutions below

0
Justin Broughton On BEST ANSWER

A quick update here. Firebase Test Lab now has this feature. It is described at:

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

1
Ahmed Mounir On

Skipping analytics tracking is an already existing feature for Firebase Test Lab (formerly known as Google Cloud Test Lab). Hopefully this addresses your first concern.

The second suggestion about skipping the login screen is also something you can attempt by starting a Robo test on a special build for your app to our devices. We also add Google credentials to the device so if your app supports a "Login using Google" mechanism, it should automatically be logged into and crawled.

Finally, I can't understand what you mean by "way of determining if your app is running in Cloud Test Lab"? It seems you mean the Play Pre-Launch Report in this case, which is powered by Firebase Test Lab and provides a number of checks on your app when you launch it to the Alpha or Beta channels on the Play Developers Console. This is meant to be used as a final check for the quality of your app but it might be difficult to rely on it during your day-to-day development process.