How to Use Debug View in Firebase Analytics
To use
DebugView in Firebase Analytics, enable debug mode on your device by running adb shell setprop debug.firebase.analytics.app <your_app_package> for Android or adding -FIRDebugEnabled argument for iOS. Then open the Firebase console's DebugView tab to see real-time event data from your app.Syntax
DebugView requires enabling debug mode on your device and then viewing events in the Firebase console.
- Android: Use
adb shell setprop debug.firebase.analytics.app <your_app_package>to enable debug mode. - iOS: Launch the app with
-FIRDebugEnabledargument or set environment variable. - Firebase Console: Navigate to
Analytics > DebugViewto see live events.
bash
adb shell setprop debug.firebase.analytics.app com.example.myapp
Example
This example shows how to enable debug mode on an Android device and view events in Firebase DebugView.
bash
1. Connect your Android device via USB and enable developer mode. 2. Run the command: adb shell setprop debug.firebase.analytics.app com.example.myapp 3. Launch your app and trigger events. 4. Open Firebase Console > Analytics > DebugView to see events in real time.
Output
No direct terminal output; events appear live in Firebase DebugView.
Common Pitfalls
- Not enabling debug mode on the correct device or app package name.
- Forgetting to restart the app after enabling debug mode.
- Using DebugView too long without disabling debug mode can flood your analytics.
- On iOS, missing the
-FIRDebugEnabledlaunch argument or environment variable.
bash
Wrong way: adb shell setprop debug.firebase.analytics.app wrong.package.name Right way: adb shell setprop debug.firebase.analytics.app com.example.myapp
Quick Reference
| Step | Command / Action | Description |
|---|---|---|
| 1 | adb shell setprop debug.firebase.analytics.app | Enable debug mode on Android device |
| 2 | Launch app | Start your app to send events |
| 3 | Firebase Console > Analytics > DebugView | View live events in Firebase |
| 4 | adb shell setprop debug.firebase.analytics.app .none. | Disable debug mode when done |
Key Takeaways
Enable debug mode on your device using the correct app package name before testing.
Use Firebase Console's DebugView to see real-time analytics events from your app.
Remember to restart your app after enabling debug mode to start sending debug events.
Disable debug mode after testing to avoid polluting your analytics data.
On iOS, enable debug mode by adding the -FIRDebugEnabled launch argument.