分析crash文件必备条件:crash文件的uuid,app的uuid,dsym文件的uuid必须一致
1> crash文件的uuid为Binary Images:0x4000 - 0x1173fff后面的32个字符组成
2> 使用dwarfdump检查app的UUID。命令行格式:
dwarfdump --uuid YourApp.app/YourApp
3> 用dwarfdump检查dSYM的UUID。命令行格式:
dwarfdump --uuid YourApp.app.dSYM
定位crash位置
如果crash文件如下:
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x3b6831fc 0x3b670000 + 78332
1 libsystem_pthread.dylib 0x3b6eaa4f 0x3b6e7000 + 14927
2 libsystem_c.dylib 0x3b634029 0x3b5ea000 + 303145
3 libsystem_malloc.dylib 0x3b6aad2d 0x3b6a8000 + 11565
4 libobjc.A.dylib 0x3b0cfe35 0x3b0cb000 + 20021
5 UIKit 0x334f859f 0x334ec000 + 50591
6 libobjc.A.dylib 0x3b0deb07 0x3b0cb000 + 80647
7 UIKit 0x334f8297 0x334ec000 + 49815
8 UIKit 0x334f79af 0x334ec000 + 47535
9 myApp 0x0053e383 0x4000 + 5481347
crash的地址为0x0053e383,命令行格式:
dwarfdump --lookup 0x0053e383 arch armv7 myApp.dSYM
就会显示
Line table file: 'xxxx.m' line 41, column 0 with start address 0x000000000053e370
crash在文件xxxx.m的41行