I want to disable firebase analytics from collecting & sending events when I’m building, testing & debugging via an Xcode scheme argument, if able.
I’m aware you can edit the info.plist to disable (Firebase Docs) but would prefer a solution that doesn’t require me to edit the .plist every time I’d like to switch between enabled and disabled.
Any suggestions?
2
Answers
Solution I came up with is very similar to Paul Beusterien's answer, but doesn't require a seperate scheme.
I made a copy of my current
info.plist
and named itinfo-debug.plist
. I added the required key and value to disable firebase analytics.Then I selected my scheme
Testing
and underPacking
->Info.plist File
->Debug
I set the value toinfo-debug.plist
Anytime I build and run my app in Xcode it will use
info-debug.plist
because myBuild Configuration
is set to the default:Debug
. When I archive my app it will useinfo.plist
as set by theBuild Configuration
forRelease
.You can configure two different plists into two different build targets, each with an associated scheme.
Details here.