Firebase automate uploading dsyms - Swift package manager

521 views Asked by At

We have added dependencies via SPM. Can we automate uploading dsyms with this configuration or we have to add the Firebase package using Cocoapods or Carthage.

This is my script for uploading symbols when firebase sdk is added via SPM and it doesn't work

googleServiceFileName="GoogleService-Info"

echo "Symbols Directory"
echo "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}"


"${BUILD_DIR%/Build/*}/SourcePackages/checkouts/firebase-ios-sdk/Crashlytics/run" -gsp
 "${PROJECT_DIR}/project/GoogleServicesInfo/${googleServiceFileName}.plist" -p ios "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}"
2

There are 2 answers

0
Erez Hod On

Following this documentation page by Google, you should do the following:

  1. Go to your project's build settings and search for debug information format, and set all build types to DWARF with dSYM File.
  2. Add a new Run Script phase and add the following line:
"${BUILD_DIR%/Build/*}/SourcePackages/checkouts/firebase-ios-sdk/Crashlytics/run"
  1. Under "Input Files" add the following lines:
${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}
${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${PRODUCT_NAME}
${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Info.plist
$(TARGET_BUILD_DIR)/$(UNLOCALIZED_RESOURCES_FOLDER_PATH)/GoogleService-Info.plist
$(TARGET_BUILD_DIR)/$(EXECUTABLE_PATH)

It should look something like this: enter image description here

After every run it should upload the correct symbols to Crashlytics.

0
welsonla On

If you are using Cocoapods to install firebase frameworks, try this:

"${SRCROOT}/Pods/FirebaseCrashlytics/run"