Reputation: 47975
I have a new app which also includes Firebase Analytics. After some work I got it manged to block Analytics from debug builds, however I see events from the monkey tests in the cloud which I want to block since they break my statistics for now. Is there any reliable way to achieve that?
Upvotes: 0
Views: 761
Reputation: 14182
One way to do this is to disable Firebase analytics if the 'device under test' is in the Test Lab IP Range.
See my answer here for a Util method that does this. https://stackoverflow.com/a/54954273/114549
Upvotes: 0
Reputation: 317778
The most reliable scheme is to only test your app using a build/variant against a Firebase project where stats are not important. I'm assuming your "production" app stats are important and your "dev" stats are not. We encourage developers to use multiple projects for precisely this reason.
If you absolutely need to test against a production Firebase project, there are ways to disable Analytics both at build time and run time.
Upvotes: 1