- 可以直接在 Organizer -> Crashes 查看
xcode 可以自动符号化对应的 log, 如果打开 bitcode, 会自动下载 dsym 文件
Binary Images: 0x100d88000 - 0x100f37fff ???? arm64 <7c765b0fe7593e4894127c757f6a1d46>
<7c765b0fe7593e4894127c757f6a1d46> 就是对应dsym 的 uuid.
bitcode 下载的文件名就是 uuid 命名的.
如果是 xcode 生成的, 则需要自己
xcrun dwarfdump --uuid xxxx.dsym
yanhu@C02RG2UCG8WM ~ % xcrun dwarfdump --uuid /Users/yanhu/Desktop/xxxx.app.dSYM
UUID: E4A734F0-0AFA-35E9-A3F1-8983A32BA875 (armv7) /Users/yanhu/Desktop/xxxx.app.dSYM/Contents/Resources/DWARF/DiaBox
UUID: 467373D3-FD6A-3D1D-88BB-00A1A403BFAA (arm64) /Users/yanhu/Desktop/xxxx.app.dSYM/Contents/Resources/DWARF/DiaBox
yanhu@C02RG2UCG8WM ~ %
- lldb 的使用
$lldb
(lldb) command script import lldb.macosx.crashlog
"crashlog" and "save_crashlog" command installed...
...
(lldb) crashlog /path/xxxx.crash
error: Unable to locate any executables from the crash log.
Try loading the executable into lldb before running crashlog
(lldb) and/or make sure the .dSYM bundles can be found by Spotlight.
如果报上面的错误, 则代表你的 path 有问题
Binary Images:
0x100d88000 - 0x100f37fff DiaBox arm64 <7c765b0fe7593e4894127c757f6a1d46> /Users/yanhu/Library/Developer/Xcode/Archives/..../dSYMs/7c765b0f-e759-3e48-9412-7c757f6a1d46.dSYM/Contents/Resources/DWARF/xxxx
把 .crash 中的 path 修改成 dSYM 所在的 path, 这样就可以手动符号出来数据了.
- disassemble 转汇编
disassemble -a 0x1000022ea
Understanding Crashes and Crash Logs
获取 os log 记录的方式
sudo log collect --device --start '2020-09-20 1:00:00' --output log.logarchive
网友评论