39

I have setup firebase in both the console and in the app. Everything configures correctly, and events appear to be logging in the app.

Output to console:

<FIRAnalytics/DEBUG> Logging event: origin, name, params: app, 
log_something, {
        "_o" = app;
        "full_text" = khbsdpibdsjl;
        name = lwkjbgskljsavdkjl;
    }

I have the debug flag enabled: -FIRDebugEnabled.

Yet in the debugging events console there is NOTHING. I see no devices available, no events being logged, absolutely 0 indication of anything connected. I must be missing something?

edit: I have been following this for setting up Debugging Events. https://firebase.google.com/docs/analytics/debugview#enabling_debug_mode

I am seeing events in the StreamView, but nothing in the debug view even though I have debug mode enabled.

2
  • 2
    For me at least, no events were being logged when I was testing the analytics logging feature on the simulator. However, when I tried it on an actual iPhone, it worked! Commented Sep 6, 2021 at 2:01
  • This comment was the solution. Commented Jun 26, 2023 at 8:33

14 Answers 14

52

Try this , This is work for me ,

Follow below steps ,

1.In Xcode, select Product → Scheme → Edit Scheme.

enter image description here

2.Select Run from left Menu and Select Arguments tab In the Arguments Passed on + option

add -FIRDebugEnabled

enter image description here

For detail debug view follow steps DebugView track Firebase doc

To send an event in Xcode project follow code below,

Objective C

[FIRAnalytics logEventWithName:@"share_image"
                    parameters:@{@"name": name, @"full_text": text}];

Swift

Analytics.logEvent("share_image", parameters: ["name": name, "full_text": text])

For events log follow detail steps Log events in Application Firebase doc

Hope this will help someone.

Sign up to request clarification or add additional context in comments.

3 Comments

You can understand the effect of the visuals from this answer.
This also helps to run via the VSCode later.
Does this work with Firebase app distribution? Where would I see the logs?
36

Make sure to add ONE DASH before -FIRDebugEnabled

I wasted a whole day making silly mistake having missed that DASH

Hope that doesn't happen to others!

6 Comments

It has been 3 years since you commented and it still help :D
still helping. I wasted a whole day trying to figure this out and nothing worked but this
dash was getting omitted for some reason when copy pasted... I had to manually type it in after revisiting scheme. thanks!
Glad it is still helping!
you saved my day.Thanks a ton !!!
|
33

Make sure to remove the OS_ACTIVITY_MODE:disable from the Environment Variables in your project scheme if you added it at some point.

1 Comment

someone had put OS_ACTIVITY_MODE=${DEBUG_ACTIVITY_MODE} in our debug build, which was sometimes enabled and sometimes disabled, depending on what version of XCode you were running
26

Now it doesn't matter much but still for the people who are getting errors on this issue. Debug mode of firebase analytics does not work sometimes due to issue in GoogleServices-Info.plist file Simply makes these 2 changes.

  1. Set IS_ANALYTICS_ENABLED to YES
  2. Set FIREBASE_ANALYTICS_COLLECTION_DEACTIVATE to NO

3 Comments

Does the key FIREBASE_ANALYTICS_COLLECTION_DEACTIVATE is still relevant? new GoogleServices-Info.plist files do not contains such field
isn't it FIREBASE_ANALYTICS_COLLECTION_DEACTIVATED
@Abdullah, thank you so much! I would not have guessed that the plist would have an analytics flag disabled! Wow.
13

Alternatively you can do that inside your AppDelegate:

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {

    var newArguments = ProcessInfo.processInfo.arguments
    newArguments.append("-FIRDebugEnabled")
    ProcessInfo.processInfo.setValue(newArguments, forKey: "arguments")
    
} 

---EXTRA---

And just some thoughts:

Regarding

Firebase.Analytics.setAnalyticsCollectionEnabled(true)

If we inspect the method:

enter image description here

So it's kind of POINTLESS...

1 Comment

On latest firebase version (SPM) i'm not able to log in debug mode using the ProcessInfo.processInfo programmatically. Is it working for you? In order to back it working, I have to set the -FIRDebugEnabled in Xcode settings.
8

I also have the same problems.

1 check your Cocopods' s Firebase version.

  • use pod update Firebase
  • List item
  • make sure that is the latest

2 open debug mode

  • In the Arguments Passed On Launch part
  • add - FIRDebugEnabled.

2 Comments

I getting some very quirky and unstable results. The debug stream works, and suddenly it stops showing events,
The events were recorded once I updated Firebase by updating pods. So it worked for me.
7

I made it possible by writing the following:

func application(_ application: UIApplication, didFinishLaunchingWithOptions, ...) {
    // some other initialization

    FirebaseApp.configure()
    Firebase.Analytics.setAnalyticsCollectionEnabled(true)
}

2 Comments

I was skeptical based on comments that it is enabled by default + I had confirmed it was enabled in the plist. But yeah it did not work until I added this line.
still relevant? I'm using FirebaseAnalytics and it also comment that the setAnalyticsCollectionEnabled sets to true by default
4

If you've done everything that the Firebase documentation states, then it could be that you have the wrong "Debug Device" selected in Firebase Analytics' "Debug View". After changing the debug device in the top left, all my analytics events from before were displayed! So it wasn't that my events weren't being sent to Firebase, I was just seeing the wrong view. Image attached.

Debug Device Picker

Comments

2

Check if you have an ad blocker enabled while visiting the Firebase website.

I had uBlock origin enabled and it would block every page (Dashboard, Events, StreamView, DebugView...) and they'd all be blank.

Everything worked as expected as soon as I whitelisted it.

Comments

2

Had this issue a few days ago, after trying every solution I found on the internet and none of them working, these are the steps I used to finally enabled DebugView to find my device:

  1. Close the app on the device you’re working on

  2. Go to the Firebase console and sign out of your account

  3. Sign back in again, go to the console and select the project you’re working on.

Again, not sure if this made a difference however do NOT click on DebugView item under the “Project shortcuts” list. Instead, click on the “Analytics” drop-down and select DebugView from there.

  1. It may be possible that this process updates the data stream used in the DebugView page - after following these steps I noticed events which had been missed initially were now showing up - almost as if the event was sent/received properly however the DebugView wasn’t showing the correct data stream.

Bonus tip:

Had issues with this again today, and after signing out/in to Firebase the DebugView still wasn't finding my device. What fixed it was, on my device, move the app into the background i.e. swipe up from the bottom to go to the home screen...

When you re-open the app into the foreground, the DebugView should now start displaying events. I imagine this works because the action of moving the app into the background I believe triggers any saved events on the device to be sent to Firebase, essentially flushing the queue.

Comments

0

I recently had an issue where the Xcode console said everything was fine, and all was being logged and sent, and I had the "-FIRDebugEnabled" and I tried all other suggestions in this thread, but nothing worked. Nothing was being sent to Firebase's DebugView.

Looking through my git-history, I determined the issue occurred due to a pod update, and the solution to my issue was another pod update.

I don't know which pod had failed, but I suspect either Moya, Alamofire or FirebaseAnalytics... after this, I'm strongly considering locking my pod-versions.

Comments

0

I had the same configuration as jaywant-khedkar, but no events or devices were showing up in the Firebase Debug View.

Found out that my pi-hole on my network was eating all the events. So if if you have any kind of ad blocker on your network, disable it and try again.

Happy debugging!

1 Comment

How to access the firebase debug view? I cant find it.
0

You probly cannot believe it but for us, the reason is someone added an AndroidClientID to our iOS Google plist. It works once I have this field removed.enter image description here

Comments

0

hmm, in my case it was Simulator. Also if you do this from analytics page, not Firebase by default the property <key>IS_ANALYTICS_ENABLED</key> of Google Info.plis is set to false for some reason.

I run it on actual device and debugView started showing events

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.