So you want to write your own crash reporter so you can get the reports and symbolicate them?
Writing crash reports is very very hard, see these two articles from the developer of the Open Source library PLCrashReporter to get an idea what is involved: http://landonf.bikemonkey.org/code/objc/Reliable_Crash_Reporting.20110912.html and http://landonf.bikemonkey.org/code/crashreporting/Reliable_Crash_Reporting_1.1.20130119.html
In short:
- All code must be async-safe. That means you can NOT use any Objective-C code. Most of the C methods are also not async safe.
- You can (basically) not allocate new memory once a crash occurred.
All the details you are asking and the ones that are not yet asked to write such a reporter would require to write way more than could fit in an answer.
Just don't write it yourself and safe yourself some trouble. There are plenty of ready to use solutions out there. Some are Open Source and can be validated if they are safe to the above rules, some are closed source and cannot be easily validated (The articles above do go into details for some of them).
I will not make any recommendation on the various solutions, since I am biased as I am a developer of one Open Source and one commercial solution. The articles linked above do analyze some of the available solutions.
So here are some.
Open Source:
- PLCrashReporter: Uses in thousands of apps since 2009. Safe, reliably, creates standard format crash reports that can be symbolicated.
- KSCrash: Pretty new. Creates standard format crash reports. Can connect to different server solutions.
- QuincyKit: Client SDK and PHP based server component based on PLCrashReporter. Makes integrating PLCrashReporter easy and server component collects reports and groups them once they are symbolicated. Symbolication can be automated using your own Mac to do the actual symbolication. (Disclaimer: I am the developer of this)
Hosted/Commercial Solutions:
- Bugsense: Free and paid plans. Uses PLCrashReporter under the hood. Rest of the SDK seems to be closed source. Server side symbolication.
- BugSnag: Free and paid plans. Open Source SDK. Uses KSCrash under the hood.
- Crashlytics: Free. Closed source. Did use PLCrashReporter under the hood, now use their own implementation. Server side symbolication.
- Crittercism: Free and paid plans. Uses PLCrashReporter under the hood. Rest of the SDK seems to be closed source. Server side symbolication.
- HockeyApp: Paid plans, 1 month trial. Uses PLCrashReporter under the hood, all SDKs open source. Creates standard format crash reports. Server side symbolication. (Disclaimer: I am one of the Co-Founders and developers of this)
- Sentry: Paid, Pretty new, Open Source (SDK and Server). Uses KSCrash under the hood.
- Testflight: Free, closed source. Server side symbolication.
There surely are some more out there which I forgot about.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…