Symbolicating iPhone App Crash Reports

2018-12-31 00:25发布

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 to the App Store and I have the dSYM file that was generated as part of the build.

I have all of these files together inside a single directory that is indexed by spotlight.

What now?

I have tried invoking:

symbolicatecrash crashreport.crash myApp.app.dSYM

and it just outputs the same text that is in the crash report to start with, not symbolicated.

Am I doing something wrong?

25条回答
忆尘夕之涩
2楼-- · 2018-12-31 00:52

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

查看更多
何处买醉
3楼-- · 2018-12-31 00:54

Steps to symbolicate a crash report automatically using XCode:

UPDATED FOR XCODE 9

  1. Connect any iOS device to your Mac (yes a physical one, yes I know this is stupid)

  2. Choose "Devices" from the "Window" menu enter image description here

  3. Click your device on the left and VIEW DEVICE LOGS on the right enter image description here

  4. Wait. It might take a minute to show up. Maybe doing Command-A then Delete will speed this up.

  5. Critical undocumented step: rename the crash report that you got from iTunesConnect from .txt extension to .crash extension

  6. Drag the crash report into that area on the left enter image description here

And then Xcode will symbolicate the crash report and display the results.

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

查看更多
牵手、夕阳
4楼-- · 2018-12-31 00:55

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.

enter image description here

enter image description here

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.

enter image description here

enter image description here

enter image description here

enter image description here

查看更多
只靠听说
5楼-- · 2018-12-31 00:56

With the latest version of Xcode (3.2.2), you can drag and drop any crash reports into the Device Logs section of the Xcode Organiser and they will automatically by symbolicated for you. I think this works best if you built that version of the App using Build & Archive (also part of Xcode 3.2.2)

查看更多
忆尘夕之涩
6楼-- · 2018-12-31 00:57

For those using Airbrake, there's a solid response above but it wouldn't work for me without tweaking:

Works for some memory addresses but not others, not sure why...

  • Create new dir on desktop or wherever
  • Find archive in question in Xcode organizer
  • Double tap to reveal in finder
  • Double tap to show bundle contents
  • Copy .dSYM file and .app file into new dir
  • cd into new dir
  • Run this command: atos -arch armv7 -o 'Vimeo.app'/'Vimeo'
  • Terminal will enter an interactive move
  • Paste in memory address and hit enter, it will output method name and line number
  • Alternatively, enter this command: atos -arch armv7 -o 'Vimeo.app'/'Vimeo' To get info for one address only
查看更多
宁负流年不负卿
7楼-- · 2018-12-31 00:58

I had to do a lot of hacking of the symbolicatecrash script to get it to run properly.

As far as I can tell, symbolicatecrash right now requires the .app to be in the same directory as the .dsym. It will use the .dsym to locate the .app, but it won't use the dsym to find the symbols.

You should make a copy of your symbolicatecrash before attempting these patches which will make it look in the dsym:

Around line 212 in the getSymbolPathFor_dsymUuid function

212     my @executablePath = grep { -e && ! -d } glob("$dsymdir" . "/Contents/Resources/DWARF/" . $executable);

Around line 265 in the matchesUUID function

265             return 1;
查看更多
登录 后发表回答