how to generate crash report using code like crash report provided by Apple

前端 未结 3 444
清酒与你
清酒与你 2020-12-10 10:06

i want to generate crash report for Symbolicate iOS Crash to View Crash Logs,so i want to get the crash report using code,at present i only get :

* -[__NS

相关标签:
3条回答
  • 2020-12-10 10:22

    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.

    0 讨论(0)
  • 2020-12-10 10:23

    In Xcode target,

    set 'Debug information Formate' to DWARF.

    Generate Debug Symbols : Yes

    Strip Debug Symbols During Copy: YES

    See image for more info. In final upload make sure you revert same. This is for testing. enter image description here

    0 讨论(0)
  • 2020-12-10 10:37

    For this you need to have a dYSM file that was generated at the time of creating your distribution build.

    Below link can be of some help to you..

    Symbolicating iPhone App Crash Reports

    0 讨论(0)
提交回复
热议问题