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?
Asked
Active
Viewed 643 times
0
-
The IP-Ranges can be found here: https://firebase.google.com/docs/test-lab/overview#testlab_and_mobile_advertising – rekire Feb 19 '17 at 09:27
2 Answers
1
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.

Doug Stevenson
- 297,357
- 32
- 422
- 441
-
That reference is nice. I didn't found that yet. That is much simpler then my way to block the analytics code. – rekire Feb 19 '17 at 09:26
-
2The problem is that the tests are run by Google when you upload to the play store. – theJosh Jun 25 '20 at 01:19
0
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

aaronvargas
- 12,189
- 3
- 52
- 52
-
Please don't add the same answer to multiple questions. Answer the best one and flag the rest as duplicates. See [Is it acceptable to add a duplicate answer to several questions?](//meta.stackexchange.com/q/104227). – double-beep Mar 08 '19 at 17:34