[ad_1]
Firebase crashlytics SDK helps builders to get actual time crash studies of their apps. Crashlytics SDK logs down a crash and supply data to the developer the place precisely its coming from. This fashion, developer can repair crash prevalence in app subsequent launch and make app extra secure to its customers. On this tutorial, we’re going to learn to combine Firebase Crashlytics SDK in our iOS app utilizing swift language.
Including Firebase SDK
Very first thing we have to add Firebase SDK and different dependencies to our venture. Comply with the beneath given steps so as to add Firebase SDK to the venture.
- Go to https://console.firebase.google.com/
- Click on on Add venture.
- Enter venture identify.
- Hyperlink Google analytics to the venture.(Comply with the steps proven by Firebase console window)
- Choose present location(nation we’re residing in).
- Settle for circumstances and click on on create venture.
- Click on Proceed.
- A display with our venture dashboard will open up.
- Click on on iOS icon as we wish to add Firebase SDK for iOS.
- Comply with the 5 steps, as described within the internet web page. (Be aware:- One can selected completely different set up strategies, however the advisable one is by way of SPM(Swift Bundle Supervisor))
Utilizing Firebase Crashlytics SDK
Comply with beneath Steps:
- Drag and drop GoogleService-Information.plist into the venture folder.
- Open AppDelegate.swift and import Firebase, followe by configure command.
import UIKit
import Firebase
@essential
class AppDelegate: UIResponder, UIApplicationDelegate {
func utility(_ utility: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override level for personalisation after utility launch.
FirebaseApp.configure()
return true
}
}

- Choose the venture in Mission Naviagtor
- Choose venture goal listed below TARGETS, in our case its ‘CrashlyticsDemo‘.
- Choose Construct Phases.
- Click on on + icon, then choose New Run Script Section.
- Below shell part add beneath run script
"${BUILD_DIR%/Construct/*}/SourcePackages/checkouts/firebase-ios-sdk/Crashlytics/run"
Be aware:- In case you are utilizing cocoa pods for set up, then it is advisable to add given beneath shell command
"${PODS_ROOT}/FirebaseCrashlytics/run"
The above scripts are required as crashlytics requires, app to add debug symbols. Run script construct part for Xcode will mechanically add debug symbols post-build.
Subsequent steps is to add DYSM information. Within the Enter Information part, add the paths for the areas of the next information:
- The situation of venture’s dSYM information:
${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Assets/DWARF/${TARGET_NAME}
As per documentation, offering the situation of your venture’s dSYM information allows Crashlytics to course of dSYMs for giant apps extra shortly.
2. The situation of your venture’s constructed Information.plist file:
$(SRCROOT)/$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)
As per Firebase crashlytics documentation, offering the situation of your venture’s constructed Information.plist file allows Crashlytics to affiliate an app model with the dSYMs.
Lastly, below Construct Settings of TARGETS and PROJECT. Seek for Debug data format, and set it as “DWARF with DYSM file”.

The place to go from right here
On this publish, we realized about how can we use Firebase crashlytics in iOS app utilizing swift language. Given benefits supplied by crashlytics to report crash inside app in a really descriptive means, it’s a really needy factor to make use of within the cell app.
[ad_2]
