如何从客户的iPhone崩溃日志? [英] How to get iPhone crash log from customers?

查看:163
本文介绍了如何从客户的iPhone崩溃日志?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人知道如何从客户那里获取崩溃日志?

Does anyone knows how to get crash logs from customers? Instead of manually asking them to sync and go to this directory and this directory and send it.

有没有自动的方式来向我们的服务器发送崩溃报告?

Is there any automatic way to do send a crash report to our server?

推荐答案

您可以使用 PLCrashReporter 。通常,您将崩溃日志写入文件,然后在下次应用启动时将其发送到服务器。

You can perform your own crash-logging with PLCrashReporter. Typically, you write the crash log to a file and then send it to a server the next time the app starts.

为了防止无限的崩溃报告循环在早期版本中有一个),您想以特定顺序执行操作:

In order to prevent an infinite crash-reporting loop (there was one in an early version), you want to do things in a specific order:


  1. 将文件读取到内存并将其删除。 (希望这不会崩溃。)

  2. 解析崩溃报告并将其发送到服务器。

  3. 最后,启用崩溃报告(因此,如果其在步骤1或2中崩溃,则崩溃不是记录的)。

  1. Read the file to memory and delete it. (Hopefully this won't crash.)
  2. Parse the crash report and send it to the server. (If it crashes now, the file has been deleted, so it shouldn't happen again.)
  3. Finally, enable crash reporting (so if it crashes in steps 1 or 2, the crash isn't logged).

无论如何,你应该有一个您要发送崩溃报告吗?对话。我认为默认的EULA允许自动崩溃日志记录,但它不会伤害到对你的用户很好。

In any case, you should have a "Oops, it crashed! Do you want to send a crash report?" dialog. I think automatic crash-logging is permitted by the default EULA, but it doesn't hurt to be nice to your users.

如果你担心永远丢失报告如果用户说没有,而不是删除报告,你可以做logrotate风格的样式重命名(即重命名report8到report9,重命名report7到report8,...,重命名报告report0)。然后有一个发送最后N个崩溃报告按钮(设置N = 10或计算报告数量),因此即使他们不小心禁用(或他们当时没有互联网),他们仍然可以发送报告。

If you're worried about losing reports forever if the user says "no", instead of deleting the report, you can do logrotate-style style renaming (i.e. rename report8 to report9, rename report7 to report8, ..., rename report to report0). Then have a "send last N crash reports" button (either set N=10 or count the number of reports), so even if they've accidentally disabled it (or they had no internet at the time), they can still send the report.

这篇关于如何从客户的iPhone崩溃日志?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆