获取上一次运行,在iPhone上崩溃日志 [英] Get previous run, crash logs on iPhone
问题描述
我试图编写一个崩溃报告功能,当您在崩溃后启动应用程序,它会提供将崩溃报告发送到服务器。我找不到如何获取应用程序中的崩溃日志。我看到有一个框架( PLCrashReporter ),但是这个框架很大,我不需要大部分的功能。
I trying to write a a crash report feature that when you launch the app after a crash, it will offer to send the crash report to the server. I can't find how to get the crash log within the app. I saw there is a framework that doing so (PLCrashReporter), however this framework is large and I don't need most of it's features.
有谁知道如何简单地访问日志?
Does anyone knows how to simply access the log?
谢谢,
Guy。 p>
Thanks, Guy.
推荐答案
我有这个类似的问题,PLCrashRep似乎太复杂,我想做的。
请注意,您无法访问Apple生成的崩溃报告,PLCrashReport生成它自己的报告并将它们存储在用户的缓存文件夹中。
I had this similar issue and the PLCrashReported seemed too complicated for what I wanted to do. Note that you can't access the crash report generated by Apple, the PLCrashReport generates it's own reports and store them in the user's cache folder.
最后,我使用以下示例:
http://cocoawithlove.com/2010/05/handling-unhandled-exceptions-and.html
Eventually, I used the following example: http://cocoawithlove.com/2010/05/handling-unhandled-exceptions-and.html
这非常简单使用,只需注册异常和信号处理程序使用:
it's very simple and easy to use, just register exception and signal handlers using:
NSSetUncaughtExceptionHandler(&HandleException);
signal(SIGABRT, SignalHandler);
signal(SIGILL, SignalHandler);
signal(SIGSEGV, SignalHandler);
signal(SIGFPE, SignalHandler);
signal(SIGBUS, SignalHandler);
signal(SIGPIPE, SignalHandler);
并使用 backtrace
UncaughtExceptionHandler
类中的方法。
这篇关于获取上一次运行,在iPhone上崩溃日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!