iPhone sdk 以编程方式读取崩溃文件?
我想以编程方式读取崩溃文件。 我该怎么做?
我可以这样做吗?如果我这样做,我的申请会被拒绝吗?
任何建议、链接、教程都欢迎。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不确定是否可能。您无法访问日志本身,但您可以捕获未捕获的异常并生成自己的崩溃日志,我认为您可以利用这些日志
以下示例: http://cocoawithlove.com/2010/05/handling-unhandled-exceptions- and.html
非常简单易用,只需使用以下方法注册异常和信号处理程序:
并使用
backtrace
方法获取堆栈跟踪UncaughtExceptionHandler 类。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 of
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:
and get the stack trace using the
backtrace
method inUncaughtExceptionHandler
class.我认为这是不可能的(至少在未越狱的 iOS 设备上)。崩溃文件在应用程序沙箱之外编写,并通过桌面上运行的 iTunes 传输到 Apple(如果用户允许)。因此,当您将 iOS 设备与 iTunes 同步时,崩溃报告是复制到 iTunes 的项目之一。
兼容的 App Store iOS 应用程序将无法读取崩溃文件所在的目录。
I don't think this is possible (at least on a non jailbroken iOS device). The crash files are written outside the application sandbox and they are transmitted to Apple by iTunes running on a desktop (if user allows it). So when you sync the iOS device with iTunes the crash reports are one of the items that are copied to iTunes.
A compliant App Store iOS application won't be able to read the directory that the crash files are located in.