简体   繁体   English

iOS框架和崩溃报告

[英]iOS Framework and Crash reporting

I'm developing an iOS framework and I like to be able to log data for posible crashes. 我正在开发一个iOS框架,我希望能够记录可能发生的崩溃的数据。 I don't like to use external logging framework like Fabric to avoid conflicts with the main app that uses the framework. 我不喜欢使用外部记录框架(如Fabric)来避免与使用该框架的主应用程序发生冲突。 Which should be the best approach to do that. 哪种方法应该是最好的方法。 Can I use the dsym files in any way? 我可以以任何方式使用dsym文件吗? Thanks a lot. 非常感谢。

If I correctly understand what you're trying to achieve; 如果我正确理解您要达到的目标; you'd like to get crash reports from apps which link against your framework however only if they occurred directly as a result of the code provided by the framework? 您想从链接到您的框架的应用程序获取崩溃报告,但是仅当它们是由于框架提供的代码而直接发生时才显示?

This would be fairly difficult to achieve, as crashes occur at the process level rather than your framework having its own isolated 'section' or subprocess. 这将相当难以实现,因为崩溃发生在流程级别,而不是您的框架具有自己独立的“节”或子流程。

You could potentially catch some Objective-C exceptions by writing code to detect and prevent them from resulting in crashes, however major faults such as EXC_BAD_ACCESS would not be 'detectable' without processing the app's crash logs. 通过编写代码来检测并防止它们导致崩溃,您可能会捕获一些Objective-C异常,但是如果不处理应用程序的崩溃日志,则无法“检测到”诸如EXC_BAD_ACCESS主要故障。

If you decide to analyse the crash logs themselves (eg when the app next launches), this would require the dSYM of the specific application and build to symbolicate the crash. 如果您决定自己分析崩溃日志(例如,下次启动应用程序时),则需要特定应用程序的dSYM并进行构建以表示崩溃。 Once you've symbolicated the crash, you'd then need some logic to determine if the crash was likely due to your framework or not. 一旦象征了崩溃,就需要一些逻辑来确定崩溃是否可能是由于您的框架引起的。 If you receive crash reports from multiple apps, you'd need to ensure that you use the correct dSYM for each log, as this will very likely be different for each one. 如果您从多个应用程序收到崩溃报告,则需要确保对每个日志使用正确的dSYM,因为每个日志的dSYM可能会有所不同。

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

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