I\'m looking to try and symbolicate my iPhone app\'s crash reports.
I retrieved the crash reports from iTunes Connect. I have the application binary that I submitted
Even though I had been developing apps for a few years now, this was my first time debugging a binary and I felt like a complete NOOB figuring out where all the files were i.e. where is *.app *.dSYM and crash logs? I had to read multiple posts in order to figure it out. Picture is worth a thousand words and I hope this post helps anyone else in future.
1- First go to itunesconnect and download your crash logs. NOTE: Is most cases you may get something like "Too few reports have been submitted for a report to be shown." Basically not enough users have submitted crash log reports to Apple in which case you can't do much of anything at that point.
2- Now if you had not changed your code since you had submitted your binary it to Apple then Launch Xcode for that project and do Product --> Archive again. Otherwise just find your latest submitted binary and right click on it.
I did this successfully, using the following steps.
Step 1: Create a folder in desktop, I give name it to "CrashReport" and put three files ("MYApp.app", "MyApp.app.dSYM", "MYApp_2013-07-18.crash") in it.
Step 2: Open Finder and go to Applications, where you will find the Xcode application, right click on this and Click "Show Package Contents", after this follow this simple path. "Contents->Developer->Platforms->iPhoneOS.platform->Developer->Library->PrivateFrameworks->DTDeviceKit.framework->Versions->A->Resources"
OR
"Contents->Developer->Platforms->iPhoneOS.platform->Developer->Library->PrivateFrameworks->DTDeviceKitBase.framework->Versions->A->Resources"
OR
For Xcode 6 and above the path is Applications/Xcode.app/Contents/SharedFrameworks/DTDeviceKitBase.framework/Versions/A/Resources
Where you find "symbolicatecrash" file, copy this and paste it to "CrashReport" folder.
Step 3: launch the terminal, run these 3 Command
cd /Users/mac38/Desktop/CrashReport and press Enter button
export DEVELOPER_DIR="/Applications/Xcode.app/Contents/Developer" and press Enter
Steps to analyze crash report from apple:
Copy the release .app file which was pushed to the appstore, the .dSYM file that was created at the time of release and the crash report receive from APPLE into a FOLDER.
OPEN terminal application and go to the folder created above (using cd
command)
Run atos -arch armv7 -o APPNAME.app/APPNAME MEMORY_LOCATION_OF_CRASH
. The memory location should be the one at which the app crashed as per the report.
Ex: atos -arch armv7 -o 'APPNAME.app'/'APPNAME' 0x0003b508
This would show you the exact line, method name which resulted in crash.
Ex: [classname functionName:]; -510
Symbolicating IPA
if we use IPA for symbolicating - just rename the extention .ipa with .zip , extract it then we can get a Payload Folder which contain app. In this case we don't need .dSYM file.
Note
This can only work if the app binary does not have symbols stripped. By default release builds stripped the symbols. We can change it in project build settings "Strip Debug Symbols During Copy" to NO.
More details see this post
The magical Xcode Organizer isn't that magical about symbolicating my app. I got no symbols at all for the crash reports that I got back from Apple from a failed app submission.
I tried using the command-line, putting the crash report in the same folder as the .app file (that I submitted to the store) and the .dSYM file:
$ symbolicatecrash "My App_date_blahblah-iPhone.crash" "My App.app"
This only provided symbols for my app and not the core foundation code, but it was better than the number dump that Organizer is giving me and was enough for me to find and fix the crash that my app had. If anyone knows how to extend this to get Foundation symbols it would be appreciated.
I prefer a script that will symbolicate all my crash logs.
Create a folder and put there 4 things:
symbolicatecrash
perl script - there are many SO answers that tells it's location
The archive of the build that match the crashes (from Xcode Organizer. simple as Show in Finder
and copy) [I don't sure this is necessery]
All the xccrashpoint
packages - (from Xcode Organizer. Show in Finder
, you may copy all the packages in the directory, or the single xccrashpoint you would like to symbolicate)
Add that short script to the directory:
#!/bin/sh
echo "cleaning old crashes from directory"
rm -P *.crash
rm -P *.xccrashpoint
rm -r allCrashes
echo "removed!"
echo ""
echo "--- START ---"
echo ""
mkdir allCrashes
mkdir symboledCrashes
find `ls -d *.xccrashpoint` -name "*.crash" -print -exec cp {} allCrashes/ \;
cd allCrashes
for crash in *.crash; do
../symbolicatecrash $crash > ../symboledCrashes/V$crash
done
cd ..
echo ""
echo "--- DONE ---"
echo ""
When you run the script, you'll get 2 directories.
allCrashes
- all the crashes from all the xccrashpoint
will be there.
symboledCrashes
- the same crashes but now with all the symbols.
you DON'T need to clean the directory from old crashes before running the script. it will clean automatically. good luck!
atos is being deprecated so if you are running OSX 10.9 or later you may need to run
xcrun atos
Warning: /usr/bin/atos is moving and will be removed from a future OS X release. It is now available in the Xcode developer tools to be invoked via:
xcrun atos