2️⃣Crashlytics
Spring 2024 | Vin Bui
Last updated
Spring 2024 | Vin Bui
Last updated
Firebase Crashlytics is a real time crash reporting tool that helps us pinpoint crashes from our users. It makes is very easy to receive detailed insight on the events that led up to the crash, allowing us to quickly reproduce bugs and determine the root cause.
In order to set up Crashlytics, we must have a Firebase project configured for our app.
Under Project Settings > General, download the GoogleService-Info.plist
file and drag it into our project directory.
Install the Firebase SDK via CocoaPods or Swift Package Manager and choose the libraries that we want to use (in this case FirebaseCrashlytics).
Follow the instructions from the Firebase website to add the initialization code.
The official Firebase documentation does a pretty good job explaining how to set up Crashlytics so I won’t repeat it here. Follow the guide to add the SDK.
Note: If we are using CocoaPods as the package manager for our project, then there are 2 differences:
Firstly, skip Step 1 (adding Firebase through github and Swift Package Manager). The only thing we want to do from that step is check that Other Linker Flags does have -ObjC
.
Secondly, when adding a new script to Build Phases, we need to make sure to use the script ${PODS_ROOT}/FirebaseCrashlytics/run
instead of the provided script (which will search for a Swift Package Manager file that doesn’t exist)!
If we followed the documentation correctly, our app’s dSYM’s files should automatically be uploaded to Crashlytics, allowing us to read and process crashes.