Sunday, July 27, 2025
HomeiOS DevelopmentCombine Google Firebase Crashlytics in iOS app utilizing swift – iOSTutorialJunction

Combine Google Firebase Crashlytics in iOS app utilizing swift – iOSTutorialJunction


The Firebase Crashlytics SDK permits builders to obtain real-time crash experiences for his or her apps. It logs crashes and offers detailed details about their origins, enabling builders to handle and resolve points in subsequent app releases. This, in flip, enhances the app’s stability for customers. On this tutorial, we’ll discover ways to combine the Firebase Crashlytics SDK into an iOS app utilizing Swift.

Including Firebase SDK

Step one is so as to add the Firebase SDK and different dependencies to our undertaking. Observe the steps beneath so as to add the Firebase SDK to your undertaking.

  1. Go to Firebase Console.
  2. Click on on Add undertaking.
  3. Enter your undertaking identify.
  4. Hyperlink Google Analytics to the undertaking by following the steps proven within the Firebase console window.
  5. Choose your present location (nation you might be residing in).
  6. Settle for the phrases and situations, then click on on Create undertaking.
  7. Click on Proceed. A display screen along with your undertaking dashboard will open.
  8. Click on on the iOS icon as we need to add the Firebase SDK for iOS.
  9. Observe the 5 steps described on the webpage so as to add Firebase to your iOS app. Word that completely different set up strategies can be found, however the advisable technique is by way of Swift Package deal Supervisor (SPM).

Utilizing Firebase Crashlytics SDK

Observe beneath Steps:

  • Drag and drop GoogleService-Information.plist into the undertaking folder.
  • Open AppDelegate.swift and import Firebase, followe by configure command.
import UIKit
import Firebase

@most important
class AppDelegate: UIResponder, UIApplicationDelegate {

    func software(_ software: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        // Override level for personalisation after software launch.
        FirebaseApp.configure()
        return true
    }
}
Combine Google Firebase Crashlytics in iOS app utilizing swift – iOSTutorialJunction
  1. Choose the undertaking in Undertaking Naviagtor
  2. Choose undertaking goal listed underneath TARGETS, in our case its ‘CrashlyticsDemo‘.
  3. Choose Construct Phases.
  4. Click on on + icon, then choose New Run Script Section.
  5. Underneath shell part add beneath run script
"${BUILD_DIR%/Construct/*}/SourcePackages/checkouts/firebase-ios-sdk/Crashlytics/run"

Word:- 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.
Fore extra data examine this hyperlink: https://firebase.google.com/docs/ios/installation-methods

Subsequent steps is to add DYSM recordsdata. Within the Enter Information part, add the paths for the places of the next recordsdata:

  1. The situation of undertaking’s dSYM recordsdata:
${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Assets/DWARF/${TARGET_NAME}

As per documentation, offering the situation of your undertaking’s dSYM recordsdata allows Crashlytics to course of dSYMs for big apps extra rapidly.

2. The situation of your undertaking’s constructed Information.plist file:

$(SRCROOT)/$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)

As per Firebase crashlytics documentation, offering the situation of your undertaking’s constructed Information.plist file allows Crashlytics to affiliate an app model with the dSYMs.

Lastly, underneath Construct Settings of TARGETS and PROJECT. Seek for Debug data format, and set it as “DWARF with DYSM file”.

Debug information format, and set it as DWARF with DYSM file  xcode ios firebase crashlytics

The place to go from right here

On this put up, 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 method, it’s a really needy factor to make use of within the cell app.



RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments