Uploading Debug Symbols
Sentry requires a dSYM upload to symbolicate your crash logs. The symbolication process unscrambles Apple’s crash logs to reveal the function, file names, and line numbers of the crash. Upload the dSYM file using either sentry-cli or the Fastlane action.
With Bitcode
If Bitcode is enabled in your project, you will have to upload the dSYM to Sentry after it has finished processing in iTunesConnect. We also recommend using the latest Xcode version for submitting your build. The dSYM can be downloaded either with Fastlane or with sentry-cli.
Using Fastlane
Use the Fastlane action, download_dsyms, to download the dSYMs from iTunesConnect and upload to Sentry. The dSYM won’t be generated until after the app is done processing on iTunesConnect so this should be run in its own lane.
lane :upload_symbols do
download_dsyms # this is the important part
upload_symbols_to_sentry(
auth_token: 'YOUR_AUTH_TOKEN',
org_slug: 'exmaple-org',
project_slug: 'example-project',
)
end
On Prem
By default fastlane will connect to sentry.io. For on-prem you need to provide the url parameter to instruct the tool to connect to your server:
url: 'https://mysentry.invalid/'
Using sentry-cli
Download the dSYM from iTunesConnect. After that, you can upload the dSYM using sentry-cli.
- Open Xcode Organizer, go to your app, and click “Download dSYMs...”
- Login to iTunes Connect, go to your app, go to “Activity", click the build number to go into the detail page, and click “Download dSYM”
Afterwards manually upload the symbols with sentry-cli:
sentry-cli --auth-token YOUR_AUTH_TOKEN upload-dif --org exmaple-org --project example-project PATH_TO_DSYMS
On Prem
By default sentry-cli will connect to sentry.io. For on-prem you need to export the SENTRY_URL environment variable to instruct the tool to connect to your server:
export SENTRY_URL=https://mysentry.invalid/
Without Bitcode
When not using Bitcode you can directly upload the symbols to Sentry as part of your build.
Using Fastlane
If you are already using Fastlane you can use it in this situation as well:
lane :build do
gym # building your app
upload_symbols_to_sentry(
auth_token: 'YOUR_AUTH_TOKEN',
org_slug: 'exmaple-org',
project_slug: 'example-project',
)
end
On Prem
By default fastlane will connect to sentry.io. For on-prem you need to provide the api_host parameter to instruct the tool to connect to your server:
api_host: 'https://mysentry.invalid/'
Uploading Symbols with sentry-cli
Your project’s dSYM can be upload during the build phase as a “Run Script”. For this you need to set the DEBUG_INFORMATION_FORMAT to be DWARF with dSYM File. By default, an Xcode project will only have DEBUG_INFORMATION_FORMAT set to DWARF with dSYM File in Release so make sure everything is set in your build settings properly.
You need to have an Auth Token for this to work. You can create an Auth Token here.
- Download and install sentry-cli
- You will need to copy the script below into a new Run Script and set your AUTH_TOKEN, ORG_SLUG, and PROJECT_SLUG
if which sentry-cli >/dev/null; then
export SENTRY_ORG=exmaple-org
export SENTRY_PROJECT=example-project
export SENTRY_AUTH_TOKEN=YOUR_AUTH_TOKEN
ERROR=$(sentry-cli upload-dif "$DWARF_DSYM_FOLDER_PATH" 2>&1 >/dev/null)
if [ ! $? -eq 0 ]; then
echo "warning: sentry-cli - $ERROR"
fi
else
echo "warning: sentry-cli not installed, download from https://github.com/getsentry/sentry-cli/releases"
fi
- If you are using Xcode 10 or newer, you also need to add the following line to the Input Files section in the Run Script from step 2:
${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${TARGET_NAME}
On Prem
By default sentry-cli will connect to sentry.io. For on-prem you need to export the SENTRY_URL environment variable to instruct the tool to connect to your server:
export SENTRY_URL=https://mysentry.invalid/
- Package:
- cocoapods:sentry-cocoa
- Version:
- 6.0.12
- Repository:
- https://github.com/getsentry/sentry-cocoa