12
13

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

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

Posted at

リジェクト時の.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:行番号})

参考文献

12
13
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
12
13

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?