Combine 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 reviews for his or her apps. It logs crashes and offers detailed details about their origins, enabling builders to deal with and resolve points in subsequent app releases. This, in flip, enhances the app’s stability for customers. On this tutorial, we are going to learn 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 venture. Comply with the steps beneath so as to add the Firebase SDK to your venture.

  1. Go to Firebase Console.
  2. Click on on Add venture.
  3. Enter your venture identify.
  4. Hyperlink Google Analytics to the venture 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 circumstances, then click on on Create venture.
  7. Click on Proceed. A display screen together with your venture dashboard will open.
  8. Click on on the iOS icon as we need to add the Firebase SDK for iOS.
  9. Comply with the 5 steps given on the official webpage so as to add Firebase to your iOS app. Be aware that totally different set up strategies can be found, however the really useful technique is by way of Swift Package deal Supervisor (SPM).

Utilizing Firebase Crashlytics SDK in iOS

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

@important
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
    }
}
Add Run Script for Firebase Crashlytics in Xcode Ios
  1. Choose the venture in Challenge Naviagtor
  2. Choose venture 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"

Be aware:- If you’re utilizing cocoa pods for set up, then it’s good to add given beneath shell command

"${PODS_ROOT}/FirebaseCrashlytics/run"

The above scripts is required as a result of crashlytics wants, app to add debug symbols with the intention to use it to switch the symbols within the crash logs with the suitable strategies names so it is going to be readable and can make sense. Run script construct part for Xcode will mechanically add debug symbols post-build.
Fore extra information verify 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 areas of the next recordsdata:

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

As per documentation, offering the placement of your venture’s dSYM recordsdata allows Crashlytics to course of dSYMs for big 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 placement of your venture’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 info 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 submit, we discovered 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 useful factor to make use of within the cell app and a lot of the apps used it.



author avatar
roosho Senior Engineer (Technical Services)
I am Rakib Raihan RooSho, Jack of all IT Trades. You got it right. Good for nothing. I try a lot of things and fail more than that. That's how I learn. Whenever I succeed, I note that in my cookbook. Eventually, that became my blog. 
rooshohttps://www.roosho.com
I am Rakib Raihan RooSho, Jack of all IT Trades. You got it right. Good for nothing. I try a lot of things and fail more than that. That's how I learn. Whenever I succeed, I note that in my cookbook. Eventually, that became my blog. 

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here


Latest Articles

author avatar
roosho Senior Engineer (Technical Services)
I am Rakib Raihan RooSho, Jack of all IT Trades. You got it right. Good for nothing. I try a lot of things and fail more than that. That's how I learn. Whenever I succeed, I note that in my cookbook. Eventually, that became my blog.