2️⃣Crashlytics

Spring 2024 | Vin Bui

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.

Getting Started

In order to set up Crashlytics, we must have a Firebase project configured for our app.

  1. Under Project Settings > General, download the GoogleService-Info.plist file and drag it into our project directory.

  2. Install the Firebase SDK via CocoaPods or Swift Package Manager and choose the libraries that we want to use (in this case FirebaseCrashlytics).

  3. Follow the instructions from the Firebase website to add the initialization code.

Adding the SDK

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:

  1. 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.

  2. 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)!

Viewing Crashes

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.

Last updated