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
Open the podfile you created for your Firebase project and add the
For an optimal experience with Crashlytics, we recommend enabling Google Analytics in your Firebase project and adding the Firebase pod for Google Analytics to your app.
pod 'Firebase/Crashlytics' # Recommended: Add the Firebase pod for Google Analytics pod 'Firebase/Analytics'
Install the pods, then re-open your
.xcworkspacefile to see the project in Xcode:
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 3: Set up Xcode to automatically upload dSYM files
To generate human readable crash reports, Crashlytics needs your project's debug symbol (dSYM) files. The following steps describe how to configure Xcode to automatically produce your dSYMs, process them, and upload the files whenever you build your app.
Open your project's Xcode workspace, then select its project file in the left navigator.
From the TARGETS list, select your main build target.
Click the Build Settings tab, then complete the following steps so that Xcode produces dSYMs for your builds.
Click All, then search for
debug information format.
Set Debug Information Format to DWARF with dSYM File for all your build types.
Click the Build Phases tab, then complete the following steps so that Xcode can process your dSYMs and upload the files.
Click> New Run Script Phase.
Make sure this new Run Script phase is your project's last build phase; otherwise, Crashlytics can't properly process dSYMs.
Expand the new Run Script section.
In the script field (located under the Shell label), add the following run script.
This script processes your project's dSYM files and uploads the files to Crashlytics.
In the Input Files section, add the paths for the following files.
Add the path to your project's dSYM files
This enables Crashlytics to process dSYMs for large apps more quickly.
Add the path to your project's built
This enables Crashlytics to associate an app version with the dSYMs.
For more detailed information about dSYM files and Crashlytics (including how to manually upload dSYM files), visit Get deobfuscated crash reports.
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, and you can view and investigate crash reports and statistics in the Crashlytics dashboard.
- Customize your crash report setup by adding opt-in reporting, logs, keys, and tracking of non-fatal errors.