0
0
FirebaseHow-ToBeginner · 3 min read

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 -FIRDebugEnabled argument or set environment variable.
  • Firebase Console: Navigate to Analytics > DebugView to 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 -FIRDebugEnabled launch 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

StepCommand / ActionDescription
1adb shell setprop debug.firebase.analytics.app Enable debug mode on Android device
2Launch appStart your app to send events
3Firebase Console > Analytics > DebugViewView live events in Firebase
4adb 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.