dSYM Upload

Upload a build's dSYMs so crash and error stack traces resolve to function names, files and line numbers, laid out by thread the way Xcode shows them.

A release build's crash keeps only addresses. With that build's dSYMs uploaded, Sophonz turns them into functions and source locations like GalleryView.body.getter (GalleryView.swift:42). dSYMs are kept under the app's app version and matched by the binary image UUIDs in the stack trace.

What gets resolved

DataAttributeContents
Crashesspz.payload (KSCrash report)Every thread, the crash reason (EXC_BREAKPOINT / SIGTRAP …), registers, binary images
Error logsspz.stacktrace.iosFrames of the thread that logged

Every frame carries its image name, image UUID, load address and instruction address, so the app and each framework it embeds are resolved with their own dSYM.

Apple system frameworks (UIKit, SwiftUICore, libswiftCore.dylib …) need no upload. The symbol the device recorded is Swift-demangled and shown as a readable name such as Array.subscript.getter.

Producing dSYMs

In the Release configuration, check that Build Settings > Debug Information Format is DWARF with dSYM File. It is the default for new Xcode projects.

DEBUG_INFORMATION_FORMAT = dwarf-with-dsym

Where the dSYMs end up depends on how you build:

BuilddSYM location
Xcode Archive / xcodebuild archive<name>.xcarchive/dSYMs/
Inside a Build Phase script$DWARF_DSYM_FOLDER_PATH
fastlane gym<output directory>/<app>.app.dSYM.zip

CAUTION — dSYMs are per build

Rebuilding the same source changes the UUIDs. Upload the dSYMs of the exact build you shipped, from the CI job that produced the archive.

Upload

Uploads need an app access token from Settings > project > app > Access tokens. The token is shown once.

@sophonz/cli

--file takes a .dSYM bundle, a directory holding bundles, or a zip. Given a directory, the CLI finds every .dSYM inside and uploads them as one zip.

export SOPHONZ_TOKEN=sophonz_pat_...
 
npx @sophonz/cli upload-dsym \
  --file build/MyApp.xcarchive/dSYMs \
  --version 1.4.0 \
  --build-id 120
OptionDescription
-f, --file.dSYM bundle, directory of bundles, or zip (required)
-v, --versionApp version: CFBundleShortVersionString (MARKETING_VERSION)
-b, --build-idBuild number: CFBundleVersion (CURRENT_PROJECT_VERSION)
-t, --tokenAccess token. Defaults to SOPHONZ_TOKEN
--dry-runPrint what would be uploaded

One of --version and --build-id is required. The SDK sends CFBundleShortVersionString as service.version, so the same value in --version puts the files under that version in Settings.

GitHub Actions

- name: Archive
  run: |
    xcodebuild archive \
      -scheme MyApp -configuration Release \
      -archivePath build/MyApp.xcarchive
 
- name: Upload dSYMs
  env:
    SOPHONZ_TOKEN: ${{ secrets.SOPHONZ_TOKEN }}
  run: |
    PLIST=build/MyApp.xcarchive/Products/Applications/MyApp.app/Info.plist
    npx @sophonz/cli upload-dsym \
      --file build/MyApp.xcarchive/dSYMs \
      --version "$(/usr/libexec/PlistBuddy -c 'Print CFBundleShortVersionString' "$PLIST")" \
      --build-id "$(/usr/libexec/PlistBuddy -c 'Print CFBundleVersion' "$PLIST")"

Xcode Build Phase

To upload from local archives too, add a Run Script to the target's Build Phases. The build machine needs Node.js 20 or later, and the token comes from the environment so it is never committed.

if [ "$CONFIGURATION" = "Release" ] && [ -n "$SOPHONZ_TOKEN" ]; then
  npx @sophonz/cli upload-dsym \
    --file "$DWARF_DSYM_FOLDER_PATH" \
    --version "$MARKETING_VERSION" \
    --build-id "$CURRENT_PROJECT_VERSION"
fi

Add ${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME} to the script's Input Files so it runs after the dSYM exists.

curl

A zipped dSYM can also be uploaded directly:

cd build/MyApp.xcarchive/dSYMs && zip -r ../../dSYMs.zip . && cd -
 
curl -X POST https://app.sophonz.ai/api/v1/mapping-files \
  -H "Authorization: Bearer $SOPHONZ_TOKEN" \
  -F type=DSYM \
  -F version=1.4.0 \
  -F buildId=120 \
  -F file=@build/dSYMs.zip

How matching works

When a dSYM arrives, the UUIDs of the Mach-O images inside are recorded. Opening a stack trace looks up the dSYM whose UUID equals each frame's image UUID.

  • Upload the app and its frameworks separately or together in one zip.
  • Matching is by UUID, so the same build matches even under a different version string. The version organizes the list.
  • A file with no UUID is refused with 422 mappingInvalid.

Checking

Settings > project > app > Mapping files lists the app's versions. The list fills in from telemetry; expand a version to see its dSYMs and image UUIDs. A version that has sent telemetry without a dSYM is flagged. Create a version ahead of release with Add version.

When a crash or error comes in, expand its row in Logs or Traces. The stack trace viewer is laid out like Xcode's debug navigator:

  • The crash reason, signal and address are on top.
  • The crashed thread comes first in the thread list, with an Only threads with app frames filter.
  • Frames in the app's own binary stand out; runs of system frames are folded.
  • Inlined functions expand into indented sub-rows.
  • Binary images, Registers and Raw tabs, and a Symbolicated / Raw toggle to see the frames exactly as the device sent them.

Upload API

POST https://app.sophonz.ai/api/v1/mapping-files
Authorization: Bearer sophonz_pat_...
Content-Type: multipart/form-data
FieldDescription
typeDSYM
fileA dSYM zip, or one DWARF binary
versionApp version
buildIdBuild number (optional)

One of version and buildId is required. On success it returns 201 with the recorded UUIDs:

{
  "file": {
    "id": "cmu1...",
    "type": "DSYM",
    "version": "1.4.0",
    "buildId": "120",
    "fileName": "dSYMs.zip",
    "debugIds": ["D8D5EDD1-CD2A-32DE-8184-0E016F60AAFB"]
  }
}
StatuserrorCause
401unauthorizedToken missing, invalid, expired or revoked
400fileMissing / typeInvalid / versionRequiredMissing field
413fileTooLargeLarger than 500MB
422mappingInvalidNo Mach-O image with a UUID found
500storageFailedThe server could not store the file