GUI方式
将 .ips crash report 文件拖放到 Xcode > Window > Devices and Simulators > View Device Logs
中, 然后导出 .crash 符号化文件.
使用条件: crash report 对应的 Archive 包是在本机构建的
symbolicatecrash
symbolicatecrash 是一个 exec (可执行文件), Xcode自带, iOS 15 之前的系统产生的 crash report, 可以直接被整个符号化, 文件路径可以通过 find
来查找1 , 结果是:
/Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/symbolicatecrash
使用方式参考如下示例:
// 若执行路径与文件路径不同, 需要补充完整的URI绝对路径
$ symbolicatecrash xxx.ips xxx.dSYM > symbolicated.crash
常见问题
1. Error: “DEVELOPER_DIR” is not defined at /Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/symbolicatecrash line 69.
DEVELOPER_DIR
是执行所依赖的环境变量, 解决办法如下:
```shell
$ export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer
```
2. Error: No crash report version in xxx.ips at /Applications/Xcode.app/…/symbolicatecrash line 1365.
iOS 15 及之后的版本产生的 crash report, 格式有变, 已经无法使用 symbolicatecrash 符号化
> **Xcode 13 Release Notes > Instruments > New Features**
> To support the new JSON-format crash logs generated in macOS Monterey and iOS 15, Instruments includes a new CrashSymbolicator.py script. This Python 3 script replaces the symbolicatecrash utility for JSON-format logs and supports inlined frames with its default options. For more information, see: CrashSymbolicator.py --help. CrashSymbolicator.py is located in the Contents/SharedFrameworks/CoreSymbolicationDT.framework/Resources/ subdirectory within Xcode 13. (78891800)
3. UUID2 不匹配
// 查看dSYM文件的UUID
$ dwarfdump --uuid <dSYM path>
atos命令
CrashSymbolicator.py
思考
- 怎么查看 crash report 的 UUID ?
怎样使用
find
快速查找文件路径 ; ↩︎什么是UUID ? ; ↩︎