iOS and FirebaseCrashlytics
As of May 2020:
After Fabrics
shut down, many developers faced such issues because Fabric was automatically creating the script to upload dSYM
files from Xcode
and we never pay attention to it.
Now as Fabric
is replaced with FirebaseCrashlytics
, in order to achieve this automatic mechanism, you can create a new run script and paste this script there:
"${PODS_ROOT}/FirebaseCrashlytics/upload-symbols" -gsp "${PROJECT_DIR}/GoogleService-Info.plist" -p ios "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}"
This script will get the dSYM files and upload them to firebase servers so that you can see the crashes.
For multiple Schemes:
If your project has multiple schemes, you can simply create multiple such scripts by changing the path to the Google Plist file.
NOTE: You can also manually upload the dSYM
files using upload-symbols
tool [Check here], but it's always better to automate the process wherever we can.
EDIT: July 2020:
When you see missing dSYM files for the crash in the Crashlytics
dashboard, instead of getting the email for it, you can upload the dSYM
file for the build as soon as you submit it for Apple review or for testing via Test Flight.
Missing dSYM
is shown because when bitCode
is enabled, the App Store Connect
process the binary post uploading it and generates a new dSYM file.
You can find the dSYM file from the Activity
section in the App Store Connect
.
2020 FirebaseCrashlytics solution
You have two solutions :
1) From the command line
Go to your project folder and run :
./Pods/FirebaseCrashlytics/upload-symbols -gsp GoogleService-Info.plist -p ios <path_to_your_dsyms_zip>
You can get your dsym in Xcode organizer > right click on the archive > show in Finder -> Show content -> go to dsymm folder and compress it
2) From Xcode Build Phases
As described here (Firebase doc), you can add a Run Script phase in Xcode with this content :
"${PODS_ROOT}/FirebaseCrashlytics/run"
You also have to add these two input files under the run script :
${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${TARGET_NAME}
and
$(SRCROOT)/$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)
After hours of struggling with this problem finally solved it using this approach:
use this command in Terminal: /path/to/pods/directory/FirebaseCrashlytics/upload-symbols -gsp /path/to/GoogleService-Info.plist -p ios /path/to/dSYMs
Important thing is instead of /path/to/pods/directory
you should enter the path to your pods folder in your application folder, and instead of /path/to
you should enter the path to the GoogleService-Info.plist which is in your project folder too. And the last one is, instead of /path/to/dSYMs
you should enter the path to your archive which has the format of .xcarchive
.
For finding the .xcarchive
path, you should first archive your application, then go to XCode -> Organizer and select your build, then right click on it and select "Show in finder" and then right click on your .xcarchive
file and select "Show package contents". This is it, you can copy this path and paste it instead of /path/to/dSYMs
and then hit enter to start uploading to Firebase Crashlytics.
Check out this link for more information: Firebase Docs