ios - 如何从 PLCrashReporter 获取完整的崩溃日志

标签 ios crash plcrashreporter

我从 PLCrashReporter 解码了 plcrash 日志,但有些信息不完整:

Incident Identifier: TODO
CrashReporter Key:   TODO
...
Exception Type:  SIGBUS
Exception Codes: BUS_ADRERR at 0x1

但是我从 Organizer 得到的崩溃日志是:

Incident Identifier: 79A8A9E4-9FD2-4A53-B43F-DC32C47AA073
CrashReporter Key:   a767dd53c828e7977d7770d6d5c3c4238a2b525e
...
Exception Type:  EXC_CRASH (SIGSEGV)
Exception Codes: 0x00000000, 0x00000000

如何获得正确的事件 ID 和 CrashReporter key (我确实需要这个)?谢谢。

顺便说一句,PLCrashReporter 的日志不显示崩溃堆栈的线程名称。

最佳答案

快速代码:

let crash = PLCrashReportTextFormatter.stringValueForCrashReport(report, withTextFormat: PLCrashReportTextFormatiOS)
print("Report: \(crash)")

objective-c 代码:

NSString *crash = [PLCrashReportTextFormatter stringValueForCrashReport:report withTextFormat:PLCrashReportTextFormatiOS];
NSLog(@"Report: %@", crash);

关于ios - 如何从 PLCrashReporter 获取完整的崩溃日志,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16682969/

相关文章:

ios - 在 iOS 上捕获崩溃日志

objective-c - callStackSymbols 的缺点是什么

ios - 构建 iOS .framework,其中包含适用于所有架构的 PLCrashReporter 依赖项目

sql - UITableView 中来自 SQLite 的 iOS NSArray 的 NSDictionaries

objective-c - 如何添加 Youtube 视频

haskell /FFI : how to handle external dll crashes

iOS 7 神秘崩溃

ios - 来自 iOS 的 PayPal 错误 580001 HTTP 请求

android - 在 WKWebView/UIWebView 中启用 WebRTC 支持

Javascript while 循环更改 div 的滚动位置会导致网站崩溃