Thursday, November 10, 2016

iOS | Symbolicating Crash Reports With atos

Recently I had an issue - customer for our company iOS app sent a crash report. Due to my computer being almost out of hdd space, I constantly delete cached data and also derived data/created archives.

So, as usual, I download the crash report, open up Xcode->Window->Devices->Select-my-device->View Device logs,  and I wait until all logs are loaded, and then I drag'n'drop the new crash report. It appears, and when I click on that entry, I now wait for it to get symbolicated - you know, so that I could pinpoint the crash. Nothing happens. Turns out - it cannot symbolicate, because it is lacking that ipa file in archives.

So, what to do?

Well, it turns out that you need to use .dSYM files to Symbolicate a crash report. And this article is about how I got my crash report symbolicated.


In the crash report, I find lines that should show the location in code:

3   appName                              0x00140fd5 0x8e000 + 733141
4   appName                              0x0014253b 0x8e000 + 738619


Then I fill in parameters from those lines in this (executed in terminal) (I got the 8 from  the 0x8 )

grep --after-context=8  "Binary Images:" /Users/gtreulands/Downloads/appNameCrash_1478467392.crash | grep appName

And it returns me:

0x8e000 -   0x7a9fff +appName armv7  <88b714e5d8b731d79b9b988db94a474c> /var/containers/Bundle/Application/AE8F1973-6D91-4A64-B9F6-F0611C30C822/appName.app/appName

Now I got UUID which I can use to find the needed .dSYM file (turns out, they are stored elsewhere in your computer, even if you delete achieved ipa files).
This UUID needs to be rewritten as 8-4-4-4-12 and all caps lock:  88b714e5d8b731d79b9b988db94a474c   = > 88B714E5-D8B7-31D7-9B9B-988DB94A474C

Then I execute this command in terminal:

mdfind "com_apple_xcode_dsym_uuids == 88B714E5-D8B7-31D7-9B9B-988DB94A474C"

And if he finds, he throws out in terminal the address to the file. In my case:

/Users/gtreulands/Library/Developer/Xcode/Archives/2016-09-09/appName 09-09-16 18.28.xcarchive

So, now I go to that folder, and in that (.xcarchive is also a folder..) I find the needed .dSYM file (which is also a folder).

And now the last step - using this .dSYM file, I can find in that file code function and line number, by providing address that I got earlier from crash report:


atos -arch armv7 -o /Users/gtreulands/Desktop/appName.app.dSYM/Contents/Resources/DWARF/appName -l 0x8e000 0x00140fd5

And it throws out:

-[LEditItemListView updateDataCell:atIndexPath: ] (in appName) (LEditItemListView.m:320)






These are great documentary articles where I got the necessary information:

https://developer.apple.com/library/content/technotes/tn2151/_index.html

https://developer.apple.com/library/content/technotes/tn2151/_index.html#//apple_ref/doc/uid/DTS40008184-CH1-SYMBOLICATE_WITH_ATOS

No comments:

Post a Comment