问题描述
我想以编程方式读取崩溃文件。
我该怎么办?
I want to read crash files programmatically.How can I do this?
我可以这样做吗?如果我这样做,我的申请会被拒绝吗?
I am allowed to do this? Will my application be rejected if I do this?
任何建议,链接,教程都很好。
Any advice, link, tutorial is well come.
推荐答案
我不确定它是否可行。您无法自己访问日志,但是您可以捕获未捕获的异常并生成您自己的崩溃日志,我认为您可以使用
以下示例:
I am not sure if its possible. You can’t access the logs themselves, but you can catch uncaught exceptions and generate your own crash logs for which I think you can make use ofthe 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
class中的方法。
and get the stack trace using the backtrace
method in UncaughtExceptionHandler
class.
这篇关于iPhone sdk以编程方式读取崩溃文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!