The last few days I have come across a few people needing to use
.crash files from their running apps to debug issues. I was not really sure how to use them or if you even could when your app is built with Xamarin.iOS. I was surprised to find little conclusive information on the web, so hopefully this post will clear some things up while I share what I have learned.
If you are debugging your app locally and are connected to a device or in the simulator, you may be able to get the symbolicated crash log from Xcode directly:
- Navigate to the
Window -> Devices and Simulatorsmenu
- Select your device and choose
View Device Logs
- Find the most recent crash log for your app in the list. You can use the
Exportmenu to save the
If the above does not produce a symbolicate crash file, continue on to symbolicate it.
Collect the Files
*.dSYM file in a directory somewhere convenient like the Desktop. Keep in mind that these three files need to correspond to the same build. The
*.dSYM should be the matching file used to build the
*.app, which is the same file that produced the
*.crash. If you don't have matching files, the symbolication will not work and you will need to rebuild your
*.app and keep a copy of the matching
*.dSYM file. Once you have that, reproduce the crash with the app and symbolicate with the new
Create an Alias
Open Terminal and run this command to make working with the
symbolicatecrash tool easier.
alias symbolicate="/Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/symbolicatecrash -v"
Update the Developer Directory
Run this command:
Open Terminal again and
cd to the directory where you placed your files in the step above.
symbolicate command we aliased before with your
.app files as the parameters like this:
symbolicate -o "symbolicatedCrash.txt" "MyAppName 2-12-14, 9-44 PM.crash" "MyAppName.app"
This will symbolicate the crash file and spit out the result in a new file named "symbolicatedCrash.txt". Make sure that correct the file names from my example to match yours.
Now you can stare at a symbolicated crash file and hope that some of it makes sense to you.
Make sure that you archive the builds you upload to the store along with the
.dSYM file. This way you can symbolicate your crash reports easily. There is no way to rebuild a binary and then use an existing