The only way to debug Firebase is to pass -FIRAnalyticsDebugEnabled
on arguments passed on launch.
It's working in debug mode with my iOS device connected but I would like to deploy an AdHoc build so QA can test it without Xcode.
But it seems arguments aren't passed at launch when Xcode archives a build.
Any solution? Thanks.
Once you enable debug mode on your development devices, navigate to DebugView by selecting the arrow next to StreamView on the top nav of Google Analytics and selecting DebugView. Then, just start using your app to see your app's events being logged in the DebugView report.
To enable USB debugging, toggle the USB debugging option in the Developer Options menu. You can find this option in one of the following locations, depending on your Android version: Android 9 (API level 28) and higher: Settings > System > Advanced > Developer Options > USB debugging.
The DebugView report shows you data (from events, event parameters, and user properties) as Analytics collects the data. The report can help you set up data collection, troubleshoot issues as issues arise, and understand a user's behavior as the user explores your website or app.
I found hack solution for this, try it in your application:didFinishLaunchingWithOptions: or override AppDelegate’s init:
Objective-C:
NSMutableArray *newArguments = [NSMutableArray arrayWithArray:[[NSProcessInfo processInfo] arguments]]; [newArguments addObject:@"-FIRDebugEnabled"]; [[NSProcessInfo processInfo] setValue:[newArguments copy] forKey:@"arguments"];
Swift:
var newArguments = ProcessInfo.processInfo.arguments newArguments.append("-FIRDebugEnabled") ProcessInfo.processInfo.setValue(newArguments, forKey: "arguments")
Just some additions to the most upped answer: I would do something like this
#if DEBUG var newArguments = ProcessInfo.processInfo.arguments newArguments.append("-FIRDebugEnabled") ProcessInfo.processInfo.setValue(newArguments, forKey: "arguments") #endif
to keep it to debug. This takes that you set up -DDEBUG
in "Other Swift Flags" in Build Settings. (you need to set this for the Debug value, of course.
And then remember to put the code snippet BEFORE you initialize Firebase :-)
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