Help us understand the problem. What is going on with this article?

[Xcode]クラッシュレポートの解析手順備忘録

More than 1 year has passed since last update.

リジェクト時の.crashの解析について、よく見かけるコマンドを使ってもエラーが返ってきて確認できなかった。

$symbolicatecrash crashlog.crash {AppName}

Unsupported crash log version: 12 at /Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/symbolicatecrash line 614.

そのため以下手順を備忘録として残しておく。

手順

リリースビルドに含まれるアーカイブからビルドを抽出し以下をターミナルでコマンド実行

  • Xcode -> Window -> Organizer -> 対象のビルドを右クリック -> Show in Finder -> {AppName}.xcarchiveを右クリック-> パッケージ内容を表示し、.appファイルと./dSYMsを抽出する
{buildAppName}.xcarchive/Products/Applications/{AppName}.app
{buildAppName}.xcarchive/dSYMs/{AppName}.dSYM
  • 抽出した./dSYMより以下コマンドにてUUIDを抽出する
$ xcrun dwarfdump --uuid {AppName}.app/Contents/MacOS/{AppName}

> UUID: VVVVVVVV-WWWW-XXXX-YYYY-ZZZZZZZZZZZZ (x86_64) {AppName}.app/Contents/MacOS/{AppName}
  • .crashファイルから"Binary Image"を検索する
Binary Images:
0x10c8d5000 - 0x10c992ff7 +{identifier} (1.0 - 6) <VVVVVVVV-WWWW-XXXX-YYYY-ZZZZZZZZZZZZ> /Applications/{AppName}.app/Contents/MacOS/{AppName}
  • 得た"0x10c8d5000"をキーに.crashファイルから検索を行う
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 {identifier} 0x000000010c95205e 0x10c8d5000 + 512094
1 {identifier} 0x000000010c950e9f 0x10c8d5000 + 507551
2 {identifier} 0x000000010c950f66 0x10c8d5000 + 507750
3 com.apple.AppKit 0x00007fff98c501cb -[NSViewController _sendViewDidLoad] + 97
4 com.apple.CoreFoundation 0x00007fff9b10b3af -[NSSet makeObjectsPerformSelector:] + 239
5 com.apple.AppKit 0x00007fff98bce886 -[NSIBObjectData nibInstantiateWithOwner:options:topLevelObjects:] + 1389
6 com.apple.AppKit 0x00007fff98cd73ca -[NSNib _instantiateNibWithExternalNameTable:options:] + 696
7 com.apple.AppKit 0x00007fff98cd6ffe -[NSNib _instantiateWithOwner:options:topLevelObjects:] + 143
8 com.apple.AppKit 0x00007fff98cd61f6 -[NSViewController loadView] + 272
9 com.apple.AppKit 0x00007fff98c46ae6 -[NSViewController _loadViewIfRequired] + 75

以下を抽出。

0x000000010c95205e 0x10c8d5000

  • 下記コマンドにてクラッシュ箇所を特定する。うまくいけばクラッシュしたコードの行番号が標準出力される
$ atos -o {AppName}.app/Contents/MacOS/{AppName} -arch x86_64 -l 0x10c8d5000 0x000000010c95205e 

> HogeViewController.fugaMethod() (in {AppName}) (HogeViewController.swift:行番号})

参考文献

https://gist.github.com/bmatcuk/c55a0dd4f8775a3a2c5a

Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away