This quickstart describes how to set up Firebase Crashlytics in your app with the Firebase Crashlytics SDK so that you can get comprehensive crash reports in the Firebase console.
Setting up Crashlytics requires tasks both in the Firebase console and your IDE (like adding a Firebase configuration file and the Crashlytics SDK). To finish setup, you'll need to force a test crash to send your first crash report to Firebase.
Before you begin
Recommended: To get features like crash-free users, breadcrumb logs, and velocity alerts, you need to enable Google Analytics in your Firebase project.
If your existing Firebase project doesn't have Google Analytics enabled, you can enable Google Analytics from the Integrations tab of your
in the Firebase console. > Project settings
If you're creating a new Firebase project, enable Google Analytics during the project creation workflow.
Step 1: Enable Crashlytics in the Firebase console
Go to the Crashlytics dashboard in the Firebase console.
Make sure your app is selected from the dropdown next to Crashlytics at the top of the page.
Click Enable Crashlytics.
Step 2: Add the Firebase Crashlytics SDK to your app
Use Swift Package Manager to install and manage Firebase dependencies.
- In Xcode, with your app project open, navigate to File > Swift Packages > Add Package Dependency.
- When prompted, add the Firebase Apple platforms SDK repository:
- Choose the Crashlytics library.
- For an optimal experience with Crashlytics, we recommend enabling Google Analytics in your Firebase project and adding the Firebase SDK for Google Analytics to your app. You can select either the library without IDFA collection or with IDFA collection.
- When finished, Xcode will automatically begin resolving and downloading your dependencies in the background.
Next, configure the Firebase module:
Import the Firebase module in your
FirebaseAppshared instance, typically in your app's
// Use the Firebase library to configure APIs. FirebaseApp.configure()
// Use the Firebase library to configure APIs. [FIRApp configure];
Step 4: Force a test crash to finish setup
To finish setting up Crashlytics and see initial data in the Crashlytics dashboard of the Firebase console, you need to force a test crash.
And that's it! Crashlytics is now monitoring your app for crashes. Visit the Crashlytics dashboard to view and investigate all your reports and statistics.
- Customize your crash report setup by adding opt-in reporting, logs, keys, and tracking of non-fatal errors.