Firebase iOS Debug Console not logging anything
Asked Answered
O

12

36

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.

Oneself answered 5/6, 2017 at 17:0 Comment(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!Teets
This comment was the solution.Dockyard
M
49

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.

Marinmarina answered 26/3, 2019 at 12:6 Comment(2)
You can understand the effect of the visuals from this answer.Tetragrammaton
This also helps to run via the VSCode later.Taxiplane
H
32

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!

Heymann answered 12/8, 2019 at 13:4 Comment(4)
It has been 3 years since you commented and it still help :DMeantime
still helping. I wasted a whole day trying to figure this out and nothing worked but thisLattermost
dash was getting omitted for some reason when copy pasted... I had to manually type it in after revisiting scheme. thanks!Ezar
Glad it is still helping!Heymann
Q
31

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

Quarto answered 21/2, 2018 at 19:7 Comment(1)
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 runningPledge
A
25

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
Ari answered 26/3, 2019 at 8:36 Comment(4)
Thanks a lot. These two keys solved my problem.Give
Does the key FIREBASE_ANALYTICS_COLLECTION_DEACTIVATE is still relevant? new GoogleServices-Info.plist files do not contains such fieldEratosthenes
isn't it FIREBASE_ANALYTICS_COLLECTION_DEACTIVATEDTalkie
@Abdullah, thank you so much! I would not have guessed that the plist would have an analytics flag disabled! Wow.Confirmation
L
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...

Lucky answered 11/8, 2020 at 13:45 Comment(1)
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.Halftruth
W
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.
Weirdo answered 21/6, 2017 at 10:34 Comment(2)
I getting some very quirky and unstable results. The debug stream works, and suddenly it stops showing events,Curarize
The events were recorded once I updated Firebase by updating pods. So it worked for me.Taylor
C
7

I made it possible by writing the following:

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

    FirebaseApp.configure()
    Firebase.Analytics.setAnalyticsCollectionEnabled(true)
}
Corncob answered 8/10, 2019 at 9:10 Comment(3)
this actually helped. Thank youMollymollycoddle
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.Selfinduction
still relevant? I'm using FirebaseAnalytics and it also comment that the setAnalyticsCollectionEnabled sets to true by defaultEratosthenes
R
3

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

Ryder answered 11/12, 2021 at 1:31 Comment(0)
M
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.

Mohave answered 20/11, 2018 at 14:17 Comment(0)
R
1

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.

Rainmaker answered 27/9, 2022 at 8:53 Comment(0)
N
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.

Nacre answered 11/12, 2019 at 13:58 Comment(0)
M
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!

Merrel answered 26/2, 2021 at 16:11 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.