Skip to content

Instantly share code, notes, and snippets.

@jsramraj
Last active November 11, 2022 05:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jsramraj/88d4a28ca919f4de9313 to your computer and use it in GitHub Desktop.
Save jsramraj/88d4a28ca919f4de9313 to your computer and use it in GitHub Desktop.
Symbolicate crash logs
How to symbolicate iOS crash logs in Mac?
(Provided you have the crash log, the iOS build in which the crash occured and the .dSYM file)
1. Copy the .crash file and .dSYM file into a folder and navigate to the folder in terminal
2. Run the following command to make sure the correct XCode developer tools is selected, in case you have multiple XCode versions.
`sudo xcode-select --switch /Applications/Xcode\ 6.3.app/Contents/Developer`
3. Finally run the following command to get the symbolicated crash log in the same folder.
DEVELOPER_DIR=`xcode-select -print-path` /Applications/Xcode\ 6.3.app/Contents/SharedFrameworks/DTDeviceKitBase.framework/Versions/A/Resources/symbolicatecrash -o ./MyApp.crash ./MyApp.crash ./MyApp.app.dSYM
How to look up a memory location in the crash log?
1. Navigate to the build folder
cd /Users/theMacUser/Library/Developer/Xcode/Archives/2015-03-20/MyApp\ 20-03-15\ 3.30\ pm.xcarchive/Products/Applications
2. Copy the memory location from the crash log and run the following command with the memory location
atos -arch arm64 -o 'MyApp.app'/'MyApp' 0x00000001001553f4
Here replace the 'arm64' with the correct architecture. This crash log was taken from a iPhone6, thus arm64. If you have a different device this will be different. The architecture can be get from the crash log itself, it will be in the top of the crash log along with other information.
After running this command, the terminal will give an output which is similiar to this.
-[ASIHTTPRequest checkRequestStatus] (in MyApp) (ASIHTTPRequest.m:1493)
You can get the file name, classname, method name and the line number from this.
/Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/symbolicatecrash -o "symbolicated.txt" /Users/rthanga1/Downloads/2022/11/testflight_feedback/Symbolicate/crashlog.crash /Users/rthanga1/Downloads/2022/11/testflight_feedback/Symbolicate/Payload/MyApp.iOS.app
https://developer.apple.com/documentation/xcode/adding-identifiable-symbol-names-to-a-crash-report
% atos -arch <BinaryArchitecture> -o <PathToDSYMFile>/Contents/Resources/DWARF/<BinaryName> -l <LoadAddress> <AddressesToSymbolicate>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment