简体   繁体   English

在iOS上捕获崩溃日志

[英]Catching the crash log on iOS

The main idea is to catch the crash log (or the reason of the error) and send it to a server. 主要思想是捕获崩溃日志(或错误的原因)并将其发送到服务器。 I know that iTunes does log the crashes from the users' devices but I need to find if there's a way to get it and store it on our server. 我知道iTunes会记录来自用户设备的崩溃,但我需要找到是否有办法获取它并将其存储在我们的服务器上。

I was trying "PlCrashReporter" and i finished implementing it (as they did on this link https://www.plcrashreporter.org/documentation/api/v1.0/example_usage_iphone.html ). 我正在尝试“PlCrashReporter”,我完成了它(就像他们在这个链接上所做的那样) https://www.plcrashreporter.org/documentation/api/v1.0/example_usage_iphone.html )。

Problem 问题

The function applicationDidFinishLaunching is not called when the crash occurs. 发生崩溃时不会调用函数applicationDidFinishLaunching

Am I on the right track? 我是在正确的轨道上吗? Is there a specific function which is called upon a crash in AppDelegate ? 是否有一个特定的功能在AppDelegate崩溃时被调用?

Thanks in advance 提前致谢

EDIT 编辑

I've also tried the solution of the following question: 我也尝试过以下问题的解决方案:

iOS crash log catch, debug info.. Catch and send via email to the Dev team iOS崩溃日志捕获,调试信息..捕获并通过电子邮件发送给开发团队

It actually works but there are some errors that are cause by Swift and not Objective-C (Like Error while unwrapping optional value ) were not caught.. 它实际上有效,但有一些错误是由Swift引起的,而不是Objective-C(像展开可选值时的错误 )没有被捕获..

Any suggestions? 有什么建议么?

You should use Crashlytics . 你应该使用Crashlytics You then can use a custom web hook to receive the crash reports. 然后,您可以使用自定义Web挂钩来接收崩溃报告。

在此输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM