Prelude:
To know what are symbolicated crash logs go through
In this post, we will know how to generate symbolicated crash logs.
Symbolicating crash logs for iPhone or iPad apps involves translating raw crash logs into human-readable stack traces that identify where the crash occurred in the code.
Locate the Crash Log
- On the device:
- Open Xcode.
- Go to Window > Devices and Simulators.
- Select the connected device.
- In the device list, select Open Recent Logs.
- From a crash report file:
- If you received a
.crash
file (e.g., from a user or the App Store), ensure you have it accessible on your computer.
- If you received a
Ensure You Have the Matching dSYM File
- A dSYM file (Debug Symbol file) is needed to symbolicate the crash log. It is generated during the app’s build process.
- To find the dSYM:
- Open Xcode.
- Go to your project and open Organizer (
Window > Organizer
). - Select the app version that matches the crash.
- Download the corresponding dSYM if it’s not already available.
Symbolicate Using Xcode
- Open the
.crash
file in Xcode:- Drag and drop the
.crash
file into the Device Logs window (or use theView Device Logs
window). - If Xcode can locate the matching dSYM and app binary, it will automatically symbolicate the crash log.
- Drag and drop the
- If the log doesn’t symbolicate automatically:
- Ensure you have the correct version of the app binary and dSYM.
- Rebuild the app with the same settings (if needed).
Manually Symbolicate Using atos
If automatic symbolication fails, you can use the atos
tool:
- Locate the app’s dSYM file and binary:
- dSYM: Typically in
~/Library/Developer/Xcode/Archives/
- Binary: In the app’s
.app
file (right-click and Show Package Contents).
- Identify the memory address from the crash log.
- Use the
atos
command:
atos -arch arm64 -o /path/to/AppBinary -l <Load Address> <Crash Address>
Replace <Load Address>
and <Crash Address>
with the addresses from the log.
Mac symbolicator and Firebase crashlytics can help us in automatically handling crash log symbolication and reporting.
Once symbolication of crash log is done, crash log will now show function names, file names, and line numbers, making it easier to debug.
Tips
- Always keep dSYM files for all app versions released.
- Use version control to manage releases and associated debug symbols.
- For App Store crashes, download dSYM files from the App Store Connect under Crashes in the TestFlight/Analytics section.