苹果返回的崩溃日志解析

1,找到Xcode 自带的 symbolicatecrash工具来解析 .crash 文件

/Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/symbolicatecrash

2:找到跟 .crash 文件对应的 .xcarchive 文件

Xcode-->Window-->Organizer 找到对应的 .xcarchive 文件 -->Show in Finder
找到对应的.dsym

3,为了方便使用将刚才获取到的文件放入同一文件夹下crash

crash.txt + symbolicatecrash + .dsym

4,打开终端 输入如下命令

cd crash文件夹路径
./symbolicatecrash ./MyAppName.crash ./MyAppName.app.dSYM > MyAppCrash.log

第二种方法

$ cd /Users/admin/Desktop/crash
$ dwarfdump --uuid MyAppName.app.dSYM/
UUID: A05C1904-4D3C-362F-A224-9445A187E51E (armv7) MyAppName.app.dSYM/Contents/Resources/DWARF/MyAppName
UUID: 0E7FFFEE-7391-3634-B2AD-FA7D05F23D47 (arm64) MyAppName.app.dSYM/Contents/Resources/DWARF/MyAppName

崩溃日志里面找到UUID
Binary Images:
0x100944000 - 0x1014d7fff appName arm64 < UUID > /var/containers/Bundle/Application

0   libsystem_malloc.dylib          0x0000000219da4d58 0x219da3000 + 7512
1   libsystem_malloc.dylib          0x0000000219da4d58 0x219da3000 + 7512
2   libsystem_malloc.dylib          0x0000000219da3fec 0x219da3000 + 4076
3   libsystem_malloc.dylib          0x0000000219da3f20 0x219da3000 + 3872
4   libsystem_malloc.dylib          0x0000000219db2c18 0x219da3000 + 64536
5   CoreFoundation                  0x000000021a16222c 0x21a0b7000 + 700972
6   CoreFoundation                  0x000000021a1a29b4 0x21a0b7000 + 965044
7   CoreFoundation                  0x000000021a1a260c 0x21a0b7000 + 964108
8   CoreFoundation                  0x000000021a1a96c4 0x21a0b7000 + 992964
9   Foundation                      0x000000021ab4ea5c 0x21ab21000 + 186972
10  Foundation                      0x000000021ab6b3bc 0x21ab21000 + 304060
11  Foundation                      0x000000021ac3a8c0 0x21ab21000 + 1153216
12  Foundation                      0x000000021ab8a84c 0x21ab21000 + 432204
13  *appName*                           *0x000000010118b51c 错误地址* -[GTPDomainSonar gtp_sonarDidEnd] + 908

$ dwarfdump --arch=arm64 --lookup 错误地址 /Users/admin/Desktop/crash/MyAppName.app.dSYM/Contents/Resources/DWARF/MyAppName

你可能感兴趣的:(苹果返回的崩溃日志解析)