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

查看:37
本文介绍了如何从客户那里获取 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天全站免登陆