环境
macOS Mojave 10.14.3
Xcode10.1
iPhone6S 10.0.1
获得崩溃日志
方式一:Xcode
菜单 > Window
> Devices and Simulators
选择设备并查看设备日志(View Device Logs
)
方式二:手机
设置 > 隐私 > 诊断与用量 > 诊断与用量数据
崩溃日志的结构
头部(Header)
Incident Identifier
: 崩溃日志的唯一标识CrashReporter Key
: 匿名的设备标识Process
:进程名Path
:二进制文件路径Identifier
:包名Version
:应用版本号Code Type
: 目标架构Role
:进程终止时进程被赋予的task_role
枚举值
…
Incident Identifier: F21EC10C-018D-494F-997D-E9C9D82B2F7F
CrashReporter Key: ab7fcdf6938542fd82446362e0481f7fddba141f
Hardware Model: iPhone6,2
Process: JACrash [27195]
Path: /private/var/containers/Bundle/Application/EDDDCB8E-75CE-4638-84CA-5B7971F6EFE0/JACrash.app/JACrash
Identifier: com.ishepherdme.JACrash
Version: 1 (1.0)
Code Type: ARM-64 (Native)
Role: Foreground
Parent Process: launchd [1]
Coalition: com.ishepherdme.JACrash [4182]
Date/Time: 2019-02-08 13:03:58.7771 +0800
Launch Time: 2019-02-08 13:03:58.3811 +0800
OS Version: iPhone OS 10.0.1 (14A403)
Report Version: 104
异常信息(Exception Information)
Triggered by Thread
: 产生崩溃的线程Exception Type
: 崩溃类型
…
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 0
其他诊断信息
Application Specific Information
:在进程终止时框架捕获的错误信息
…
Application Specific Information:
abort() called
Filtered syslog:
None found
线程回溯
罗列崩溃时每个线程的调用栈情况
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x000000018af0e014 __pthread_kill + 8
1 libsystem_pthread.dylib 0x000000018afd5460 pthread_kill + 112
2 libsystem_c.dylib 0x000000018ae823f4 abort + 140
3 libc++abi.dylib 0x000000018a94d2d4 __cxa_bad_cast + 0
4 libc++abi.dyl