firebase-ios-sdk icon indicating copy to clipboard operation
firebase-ios-sdk copied to clipboard

DebugView not working in TestFlight Builds

Open LoadingIndicator opened this issue 1 year ago • 5 comments

Description

We are experiencing the problem, that the Firebase DebugView seems to no longer be working from TestFlight builds.

The documentation states to put the -FIRDebugEnabled param into the scheme launch arguments. This works, but only when starting the app from Xcode. However, for our analytics department and QA, they work with TestFlight builds provided by the devs.

Up until now we were using the following code as a workaround to mutate the launch arguments:

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

As of this thread, this is discouraged and does no longer work: https://forums.developer.apple.com/forums/thread/767584

Therefore we were looking for other solutions and fount two similar issues:

  • https://github.com/firebase/firebase-ios-sdk/issues/13598
  • https://github.com/firebase/firebase-ios-sdk/issues/13640

The workaround in these issues is supposed to be this:

UserDefaults.standard.set(true, forKey: "/google/firebase/debug_mode")
UserDefaults.standard.set(true, forKey: "/google/measurement/debug_mode")

Turns out, it still did not work for us.

We tested different devices in our company and iOS 16 and 18 did not work under any circumstances. However for two colleagues with iOS 17 devices, the DebugView is still working.

Can you please help on this issue, since this effectively blocks our analytics team from approving tracking in new features.

Reproducing the issue

No response

Firebase SDK Version

11.5

Xcode Version

16.1

Installation Method

Swift Package Manager

Firebase Product(s)

Analytics, Crashlytics, Messaging

Targeted Platforms

iOS

Relevant Log Output

No response

If using Swift Package Manager, the project's Package.resolved

Expand Package.resolved snippet

Replace this line with the contents of your Package.resolved.

If using CocoaPods, the project's Podfile.lock

Expand Podfile.lock snippet

Replace this line with the contents of your Podfile.lock!

LoadingIndicator avatar Nov 27 '24 09:11 LoadingIndicator

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

google-oss-bot avatar Nov 27 '24 09:11 google-oss-bot

Hi @LoadingIndicator, your issue seems intended and related to #13260. DebugView needs to run the app in a development environment with the -FIRDebugEnabled flag enabled in Xcode.

rizafran avatar Dec 02 '24 10:12 rizafran

It used to work with this workaround. It was possible to set those arguments in the AppDelegate.mm (react-native with Objective C).

    NSMutableArray *newArguments =
        [NSMutableArray arrayWithArray:[[NSProcessInfo processInfo] arguments]];
    [newArguments addObject:@"-FIRDebugEnabled"];
    [newArguments addObject:@"-FIRAnalyticsDebugEnabled"];
    [[NSProcessInfo processInfo] setValue:[newArguments copy]
                                   forKey:@"arguments"];

Now it is not working anymore. Not sure it is the workaround or iOS 18 or something else that stopped working.

cavaalex avatar Dec 03 '24 15:12 cavaalex

We tried this UserDefaults workaround again:

UserDefaults.standard.set(true, forKey: "/google/firebase/debug_mode")
UserDefaults.standard.set(true, forKey: "/google/measurement/debug_mode")

This workaround is actually working, but only on the second launch of the app, so apparently the first launch does not recognize the UserDefaults value.

LoadingIndicator avatar Dec 11 '24 12:12 LoadingIndicator

Got the same issue: working on simulator but not on the TestFlight version. and @LoadingIndicator solution works.

skywalkerlw avatar Jan 15 '25 01:01 skywalkerlw

@LoadingIndicator Save my life, respect!

huynamboz avatar Oct 10 '25 09:10 huynamboz

This does work! Thanks! @LoadingIndicator

yusera-ansari avatar Oct 17 '25 11:10 yusera-ansari