我想在Xcode调试器模式下使用"plcrashreporter“库。
我把"plcrashreporter“添加到我的testAPP中,然后运行,因为这个代码是if (debugger_should_exit()),testAPP crash.I。我知道因为调试器捕获所有的崩溃,而不是CrashReporter做it.Then,所以我直接通过模拟器打开应用程序,它起作用了。
但是,不能在Xcode中调试是不方便的。我猜调试器上的演示会崩溃,因为作者做了一些事情,比如debugger_should_exit().maybe也使用falg P_TRACED.I尝试修改相关的地方,但也崩溃了,以及控制台日志:
[PLCrashReport] PLCrashMachExceptionForward:648: Unsupported exception behavior: 0x1 (MACH_EXCEPTION_CODES=true)
[PLCrashReport] plframe_cursor_read_compact_unwind:66: Could not find a loaded image for the current frame pc: 0x7fff6224f35b
[PLCrashReport] grow:121: WARNING: Growing the AsyncAllocator free list via vm_allocate(). Increasing the initial size of this allocator is recommended.
[PLCrashReport] plcrash_writer_write_signal:1143: Warning -- unhandled signal sicode (signo=9, code=0). This is a bug.我发现一个应用程序已经解决了这个问题,但我不知道how.Please帮助我,谢谢。
发布于 2019-05-20 22:02:24
您是希望通过应用程序进行调试,还是只想查看日志?
您可以运行change your run schema来禁用调试模式,这将允许您查看应用程序的日志输出。因为现在禁用了调试模式,所以现在可以运行PLCrashReporter。您可以格式化打印的崩溃报告,并查看其日志内容。
guard let crashData = try? crashReporter.loadPendingCrashReportDataAndReturnError(), let reportData = try? PLCrashReport(data: crashData), !report.isKind(of: NSNull.classForCoder()) else {
crashReporter.purgePendingCrashReport()
return
}
let crash: NSString = PLCrashReportTextFormatter.stringValue(for: reportData, with: PLCrashReportTextFormatiOS)! as NSString
print("Crash report:\n \(crash)")https://stackoverflow.com/questions/41827671
复制相似问题