This quickstart describes how to set up Firebase Crashlytics so that you can get comprehensive crash reports in the Firebase console.
Before you begin
Before you can set up Crashlytics, you need to register your iOS app and configure it to use Firebase.
If your iOS app already uses Firebase, then it's already registered and configured for Firebase.
If you don't have an iOS app, you can download a sample app.
Note that adding Firebase to your iOS app involves tasks both in the Firebase console and in your open Xcode project (for example, you download Firebase config files from the console, then move them into your Xcode project).
Step 1: Set up Crashlytics in the Firebase console
Click Crashlytics in the left-hand nav panel of the Firebase console.
If your Firebase project has multiple apps registered in it, select the app you just added from the dropdown next to Crashlytics in the top bar of the console.
Click Set up Crashlytics.
Select This app is new to Crashlytics (it doesn't have any version of the SDK).
Step 2: Add the Crashlytics SDK
To get started, add the Crashlytics SDK framework files to your project's Xcode workspace. For most projects, the easiest way to do that is by adding the Crashlytics CocoaPods. However, if your project can't support CocoaPods, you can also add the files manually.
Add frameworks via CocoaPods
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'MyProject' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
# Pods for PodTest
pod 'Fabric', '~> 1.10.2'
pod 'Crashlytics', '~> 3.13.2'
pod repo update
Add frameworks manually
Fabric.framework into your project's Project navigator.
Step 3: Initialize Crashlytics
The frameworks you added include a run script that initializes Crashlytics. Add it to your project's build phases:
Open your project in Xcode, then select its project file in the Navigator.
Select your main build target from the Select a project or target dropdown.
Open the target's Build Phases tab.
Click + Add a new build phase, then select New Run Script Phase.
Add the following line to the Type a script text box:
Xcode 10 only: Add your app's built
Info.plistlocation to the Build Phase's Input Files field:
After you add the SDK to your app, Crashlytics automatically gets to work listening for and collecting crash reports.
Step 4: Build or run your project
Run your app to send verification to Firebase that you've successfully integrated Firebase.
Your device logs will display the Firebase verification that initialization is complete.
Watch a video tutorial
For detailed guidance on getting started with Crashlytics, watch the following video tutorial:
You can find more videos on the Firebase YouTube channel.
Customize crash reports— Crashlytics automatically starts collecting crash reports as soon as you add the SDK, but you can also customize your setup by adding opt-in reporting, logs, keys, and even tracking of non-fatal errors.