崩溃日志没有崩溃?
嘿,这可能是一个愚蠢的问题,但我在任何地方都找不到答案,如果很容易找到答案并且我的研究技能很差,我深表歉意。
无论如何,当应用程序不崩溃时是否可以生成崩溃报告?那么如果用户遇到错误,是否可以选择允许他们生成崩溃报告,然后将其发送给我?另外我该怎么做呢?
感谢您的帮助:)
Hey this may be a stupid question but I couldn't find the answer anywhere, apologies if the answer is easily found and if my research skills are pants.
anyway is it possible to generate a crash report when an app doesn't crash? so say if a user encounters a bug could there be an option to allow them to generate a crash report which can then be sent to me? also how would I go about doing this?
Thanks for any help :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

发布评论
评论(5)
我曾经也使用 backtrace_symbols 来处理崩溃,但后来我发现它可能很危险,因为该方法不是异步安全的。从那以后,我研究了一堆崩溃报告解决方案,并为我的应用程序选择了 Crittercism,它非常好用!
当我不得不打印堆栈跟踪时,我已经使用过它几次:
+ (NSArray *)backtrace
{
void* callstack[128];
int frames = backtrace(callstack, 128);
char **strs = backtrace_symbols(callstack, frames);
int i;
NSMutableArray *backtrace = [NSMutableArray arrayWithCapacity:frames];
for (
i = UncaughtExceptionHandlerSkipAddressCount;
i < UncaughtExceptionHandlerSkipAddressCount +
UncaughtExceptionHandlerReportAddressCount;
i++)
{
[backtrace addObject:[NSString stringWithUTF8String:strs[i]]];
}
free(strs);
return backtrace;
}
“当应用程序在 iPhone 上崩溃时,它会消失而不告诉用户发生了什么。但是,可以向应用程序添加异常和信号处理,以便可以向用户显示错误消息,或者您可以保存更改,甚至可以尝试从这种情况中恢复而不会崩溃。”
看看 http://cocoawithlove.com/2010/05/handling-unhandled -例外-and.html
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
这是我用于堆栈跟踪的内容:
您只需确保不会对您的应用程序造成任何损害:http://landonf.bikemonkey.org/2011/09/14。您还可以使用 PLCrashReporter 来处理所有崩溃,或者如果您像我一样懒,请使用类似 Crittercism 的服务
Here's what I use for my stacktraces:
You just have to make sure you don't do any harm to your app: http://landonf.bikemonkey.org/2011/09/14. You could also use PLCrashReporter to handle all your crashes or if you're lazy like me, use a service like Crittercism