iOS crash reporting and symbolication
iOS writes a crash report (an .ips file since iOS 15) every time an app crashes; you get it from the Crashes organizer in Xcode for TestFlight and App Store builds, from Settings > Analytics & Improvements > Analytics Data on the device, or from a crash reporter SDK such as Sentry's. The report's backtraces are hexadecimal addresses until you symbolicate them with the dSYM file whose build UUID matches the binary that crashed. Build with Debug Information Format set to DWARF with dSYM File, keep the Xcode archive for every build you ship, and upload the dSYMs to wherever you read crashes.
Steps
- Build with dSYMsSet Debug Information Format to DWARF with dSYM File for Release, archive, and keep the .xcarchive for every build you ship.
- Get the reportOpen the Crashes organizer in Xcode, ask the user for the log from Analytics Data, or open the issue in your crash reporter.
- Read the exception typeEXC_BAD_ACCESS, EXC_BREAKPOINT, SIGABRT and 0x8badf00d each point to a different class of bug.
- SymbolicateOpen the .ips in Xcode or run xcrun crashlog; for single frames use atos with the DWARF file inside the matching dSYM.
- Upload dSYMs to SentryRun sentry-cli debug-files upload, the Xcode build phase or the fastlane action on every release build.
Where iOS crash reports come from
| Source | What you get | Gaps |
|---|---|---|
| Xcode Organizer, Crashes | Reports from TestFlight testers (always) and App Store users who share analytics; symbolicated if you uploaded symbols with the build | No watchdog, invalid code-signature, thermal or Jetsam events |
| Device: Settings > Privacy & Security > Analytics & Improvements > Analytics Data | Every log on that phone, named <AppBinaryName>_<DateTime>, or JetsamEvent_<DateTime> for memory kills; the user can share it by Mail | One device at a time, and you have to ask the user |
| A test device connected to your Mac | The device's crash reports, transferred to the Mac and symbolicated there | Only devices you hold |
MetricKit (MXCrashDiagnostic) | Crash diagnostics delivered to your own app in an MXDiagnosticPayload | You build the upload and the symbolication yourself |
| A crash reporter SDK (for example Sentry) | Each crash as an event with breadcrumbs, tags, release and user, grouped into issues | Needs your dSYMs uploaded to symbolicate |
When you debug in Xcode, the debugger catches the crash before the OS can write a report. To get the real report, choose Debug > Detach (or type detach in the console), let the app finish crashing, then collect the log from the device.
Since iOS 15 a report is an .ips file holding two JSON objects: a one-line metadata object (crash reports have bug_type 309) followed by the report itself. Xcode and Console translate it into the familiar text layout with Exception Type, Termination Reason, one backtrace per thread and the list of binary images at the bottom.
Symbolicate an iOS crash log
An unsymbolicated frame looks like 4 TouchCanvas 0x00000001022cbfa8 0x1022c0000 + 49064: an address and an offset, no function. Symbolication replaces it with a function name, file and line, and it only works with the dSYM built alongside that exact binary. The binary and its dSYM are tied together by a build UUID; build the same code again with another Xcode version or other settings and the UUIDs no longer match.
The simplest route: open the .ips or .crash file in Xcode and pick the project when asked. Xcode symbolicates every thread it can. From Terminal:
% xcrun crashlog ~/Downloads/TouchCanvas.ipsFor a single address, read the image's architecture and load address from the binary images list and pass the DWARF file inside the dSYM bundle, not the bundle itself, to atos. -i also shows inlined functions:
% atos -arch arm64 -o TouchCanvas.app.dSYM/Contents/Resources/DWARF/TouchCanvas -l 0x10459c000 -i 0x1045a4610
@objc ViewController.touchesEstimatedPropertiesUpdated(_:) (in TouchCanvas) (/<compiler-generated>:0)If the frame shows <deduplicated_symbol>, the linker merged identical functions (on by default in release builds); add -dedup to see all of them. Apple frameworks that stay as addresses need the device symbols for the OS version in the report.
Why the dSYM is missing, most common first
- The archive is gone. The build came from CI or another Mac and nobody kept the
.xcarchive. Without it, that version can't be symbolicated; Apple's advice is to keep the archive for every build you distribute. - Debug Information Format is DWARF, not DWARF with dSYM File, for the Release configuration, so no dSYM was produced.
- Spotlight can't see it. Find the dSYM by UUID with
mdfind "com_apple_xcode_dsym_uuids == E3EA8743-C9E6-3C68-BF04-8D51363B689D". It returns nothing if indexing is off for that folder or the path contains.noindex. Check a candidate withdwarfdump --uuid <path-to-dSYM>. - A rebuild, not the shipped build. Rebuilding the same tag gives new UUIDs; the dSYM won't match.
- Third-party binary frameworks ship their own dSYMs, or don't; ask the vendor.
Bitcode no longer applies. Since Xcode 14 the App Store doesn't accept bitcode submissions, so App Store Connect no longer recompiles your binary and the dSYM from your own archive is the right one. Downloading dSYMs from App Store Connect was only ever needed for old bitcode builds. Advice to "download dSYMs from App Store Connect" for a new build is out of date.
Exception types and what they usually mean
| Exception Type | Usual cause | Where to look |
|---|---|---|
EXC_BAD_ACCESS (SIGSEGV) or (SIGBUS) | Invalid or misaligned memory access: a freed object, an unsafe pointer, a data race, or a pointer authentication failure | The crashed thread, then the Address Sanitizer and Thread Sanitizer in Xcode |
EXC_BREAKPOINT (SIGTRAP) | Swift runtime error: force-unwrapping nil, a failed as!, index out of range, fatalError | Frame 0 of the crashed thread is usually the exact line |
EXC_CRASH (SIGABRT) | abort(), most often an uncaught Objective-C or C++ exception; LAUNCH_HANG subtype for slow app extensions | Last Exception Backtrace and Application Specific Information |
EXC_CRASH (SIGKILL) with Code 0x8badf00d | Watchdog: the main thread was blocked too long at launch (scene-create) or while running (scene-update) | Termination Description and the main thread |
EXC_RESOURCE | Exceeded a CPU, memory or wakeups limit | The resource named in the report |
A watchdog report looks like this:
Exception Type: EXC_CRASH (SIGKILL)
Exception Note: EXC_CORPSE_NOTIFY
Termination Reason: Namespace SPRINGBOARD, Code 0x8badf00dThe mistake people make next with watchdog kills is trusting the backtrace. It shows what the main thread was doing when time ran out, not the four seconds of synchronous work that finished just before. Look for hidden synchronous networking such as String(contentsOf:) or Data(contentsOf:) with an https URL, Core Data migrations and large JSON parsing during launch. To read the frames themselves, see how to read a stack trace.
iOS crash reporting with Sentry
The Sentry Cocoa SDK (https://github.com/getsentry/sentry-cocoa.git via Swift Package Manager; SDK 9.25.0 and later need iOS 15) reports crashes, app hangs and watchdog terminations. Start it as early as possible, on the main thread:
import Sentry
SentrySDK.start { options in
options.dsn = "https://<key>@o<orgId>.ingest.sentry.io/<projectId>"
}Sentry's "watchdog termination" is broader than 0x8badf00d: because the OS kills the app without a crash report, the SDK infers one on the next launch from heuristics (no crash last run, app was in the foreground, no app or OS update, not quit by the user). Turn it off with options.enableWatchdogTerminationTracking = false.
Upload dSYMs on every release build, or Sentry shows the same raw addresses as an unsymbolicated report. With sentry-cli:
sentry-cli debug-files upload --auth-token $SENTRY_AUTH_TOKEN \
--include-sources \
--org acme \
--project ios \
PATH_TO_DSYMS--include-sources adds source context and needs DWARF with dSYM File. The alternatives are a Run Script build phase that runs sentry-cli debug-files upload "$DWARF_DSYM_FOLDER_PATH" (with ENABLE_USER_SCRIPT_SANDBOXING set to NO), or the fastlane plugin's sentry_debug_files_upload action; the old sentry_upload_dif action was removed in plugin 2.0.0. The wizard sets most of this up: brew install getsentry/tools/sentry-wizard && sentry-wizard -i ios.
Questions
How do I symbolicate an iOS crash report?
Open the .ips or .crash file in Xcode, or run xcrun crashlog with its path. Both need the dSYM whose build UUID matches the binary that crashed to be findable by Spotlight.
Where are crash logs on an iPhone?
In Settings > Privacy & Security > Analytics & Improvements > Analytics Data. Logs start with the app's binary name and a date, and can be shared from there.
Do I still need to download dSYMs from App Store Connect?
Not for builds made with Xcode 14 or later. The App Store no longer accepts bitcode, so the dSYM from your own archive matches; App Store Connect downloads only exist for old bitcode builds.
What does 0x8badf00d mean in an iOS crash?
It is the watchdog's termination code: the system killed the app because its main thread was blocked too long, usually during launch or while updating the UI.
Sources
- Adding identifiable symbol names to a crash reportdeveloper.apple.com
- Acquiring crash reports and diagnostic logsdeveloper.apple.com
- Addressing watchdog terminationsdeveloper.apple.com
- Uploading Debug Symbolsdocs.sentry.io