iOS崩溃日志分析

本文介绍了如何获取iOS设备的崩溃日志,并详细解析了崩溃日志的结构,包括头部信息、异常信息、线程回溯和二进制镜像等。还探讨了不同类型的异常,如野指针、异常退出等,并讲解了符号化过程以及如何通过异常捕获监听来预防和处理崩溃。
摘要由CSDN通过智能技术生成

环境

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
  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值