Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enable debug logging firebase analytics

I'm trying to enable debug logging for Firebase analytics in Android Studio. I have tried following the instructions found here and still don't see the logs I expect: https://firebase.google.com/docs/analytics/android/events#log_events

enter image description here

When I run the commands described in the link (and shown above) in the terminal within Android Studio this is the output I see:

--------- beginning of system
--------- beginning of crash
--------- beginning of main
05-19 20:14:12.794 I/FA      ( 3083): App measurement is starting up, version: 9080
05-19 20:14:12.794 I/FA      ( 3083): To enable debug logging run: adb shell setprop log.tag.FA VERBOSE

and this is what is shown in the Android Monitor tab in logcat:

05-19 20:14:12.794 3083-3083/com.nick.app I/FA: App measurement is starting up, version: 9080
05-19 20:14:12.794 3083-3083/com.nick.app I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE

What I expect to see is an indication the various "events" I have logged are logged correctly. I have seen them in the firebase developer console which leads me to believe I have implemented them properly, I would just like a quicker way to know for testing purposes.

What steps need to be taken to properly view the firebase analytics debug logs?

like image 828
ez4nick Avatar asked May 20 '16 00:05

ez4nick


3 Answers

Make sure you run the adb shell setprop log.tag.FA VERBOSE and then you restart the app. Enabling logs only works for future logs. If you have more then one device or emulator attached to the computer you might need to tell adb which one you are setting the property for. You can read the current adb properties with adb shell getprop. You should see log.tag.FA property set to VERBOSE. Once you set the log.tag.FA property it will persist until you restart the device so you only need to do that once after the device reboots.

like image 52
djabi Avatar answered Sep 27 '22 23:09

djabi


Please try to do this after input "adb root".

like image 42
user3497103 Avatar answered Sep 27 '22 21:09

user3497103


Something that are maybe obvious to most people, but took me awhile to learn:

  • this does require root, adb root did not work on my physical device.
  • an emulator will give you root, but...
  • be sure you create your emulator with an image that contains Google API's, so that it will have play services.
like image 25
ginkgoMZD Avatar answered Sep 27 '22 21:09

ginkgoMZD