Google Analytics is running in the iOS simulator.
This causes pollution in the console log which I can be looking for useful debugging information. Also, the data sent to Google is not indicative of an actual user using our app.
How can I disable the Google Analytics reporting just while running the app in iOS simulator?
From the homepage, go to Nintendo's eShop and log in to your profile. Next, tap your profile icon and scroll to the bottom of the page that loads up on the next screen. Under Google Analytics Preferences, tap Change. Select Don't Share on the next screen.
In summary, to disable temporarily, set FIREBASE_ANALYTICS_COLLECTION_ENABLED to NO in the GoogleServices-Info. plist file. To disable permanently, set FIREBASE_ANALYTICS_COLLECTION_DEACTIVATED to YES in the same plist file.
Yes, both simulator or device will work. Analytics clusters your events unless you specify it is a custom event.
Simple, this is taken straight from the Google Analytics webpage :
[[GAI sharedInstance] setDryRun:YES];
Dry Run :
The SDK provides a dryRun flag that when set, prevents any data from being sent to Google Analytics. The dryRun flag should be set whenever you are testing or debugging an implementation and do not want test data to appear in your Google Analytics reports.
Hope this helps
Yes, Setting DryRun to YES will fix this issue.
@Full Decent - Is there a way to also not have Google Analytics pollute my console logs?
We can disable Google Analytics logging in Xcode console using the below method.
[[[GAI sharedInstance] logger] setLogLevel:kGAILogLevelNone];
Or in Swift:
GAI.sharedInstance().logger.logLevel = GAILogLevel.None
Wrapping it in #if TARGET_IPHONE_SIMULATOR #endif
will not work in swift, as that flag is for objective-c only.
What you could do is follow this guide
Detect if app is being built for device or simulator in Swift
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With