How to generate a crash report using code such as a crash report provided by Apple

I want to create a crash report for Symbolicate iOS Crash to view crash logs, so I want to get a crash report using code, currently I only get:

* - [__ NSArrayM objectAtIndex:]: index 121 out of bounds [0 .. 23]

Application received signal SIGSEGV ( 0 CoreFoundation 0x3120e2bb + 186 1 libobjc.A.dylib 0x38f2b97f objc_exception_throw + 30 2 CoreFoundation 0x3120e1c5 + 0 3 myshine 0x001f9f51 myshine + 1503057 4 libsystem_c.dylib 0x393a9e8b _sigtramp + 34 5 myshine 0x000ac985 myshine + 137605 6 myshine 0x000ac35d myshine + 136029 7 CoreFoundation 0x311ab7cf + 74 ) not have / 1: Process Information Incident Identifier: 30E46451-53FD-4965-896A-457FC11AD05F CrashReporter Key: 5a56599d836c4f867f6eec76afee451bf9ae5f31 Hardware Model: iPhone4,1 Process: Rage Masters [4155] Path: /var/mobile/Applications/A5635B22-F5EF-4CEB-94B6-FE158D885014/Rage Masters.app/Rage Masters Identifier: Rage Masters Version: ??? (???) Code Type: ARM (Native) Parent Process: launchd [1] / / 2: Basic Information Date/Time: 2012-10-17 21:39:06.967 -0400 OS Version: iOS 6.0 (10A403) Report Version: 104 // 3: Exception Exception Type: 00000020 Exception Codes: 0x000000008badf00d Highlighted Thread: 0 

I want to get the same report

0
source share
3 answers

So you want to write your own crash reporter so that you can receive reports and symbolize them?

Recording crash reports is very difficult, see these two articles from the developer of the Open Source PLCrashReporter library to understand that: 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 p>

In short:

  • All code must be asynchronous. This means that you can NOT use any Objective-C code. Most C methods are also not safe for asynchronous use.
  • You can (mostly) not allocate new memory after a failure occurs.

All the details that you ask, and those that have not yet asked to write such a reporter, will require more writing than they can fit into the answer.

Just don’t write it yourself and don’t worry. There are many ready-to-use solutions. Some of them are Open Source and can be checked if they are safe for the above rules, some of them are closed and cannot be easily checked (the articles cited above are in detail for some of them).

I will not give recommendations on various solutions, as I am biased, as I am the developer of one Open Source and one commercial solution. The articles linked above analyze some of the solutions available.

So, here are some of them.

Open source:

  • PLCrashReporter : Used in thousands of applications since 2009. Safe, reliable, generates crash reports in a standard format that can be symbolized.
  • KSCrash : Pretty new. Generates crash reports in standard format. It can connect to various server solutions.
  • QuincyKit : Client SDK and PHP server component based on PLCrashReporter. It makes integration with PLCrashReporter simple, and the server component collects reports and groups them after their symbols. Symbolization can be automated using your own Mac for actual symbolism. (Disclaimer: I'm the developer of this)

Hosting / Commercial Solutions:

  • Bugsense : Free and Paid Plans. Uses PLCrashReporter under the hood. The rest of the SDK seems closed. Server side characters.
  • BugSnag : Free and Paid Plans. Open source SDK.
  • Crashlytics : Free. Closed source. Used PLCrashReporter under the hood, now uses its own implementation. Server side characters.
  • Crittercism : Free and Paid Plans. Uses PLCrashReporter under the hood. The rest of the SDK seems closed. Server side characters.
  • HockeyApp : Paid plans, 1 month trial. Uses PLCrashReporter under the hood, all open source SDKs. Generates crash reports in standard format. Symbols on the server side. (Disclaimer: I am one of the co-founders and developers of this).
  • Sentry : Paid, fairly new, open source (SDK and server).
  • Testflight : free, closed source. Server side characters.

There, of course, there is something else that I forgot about.

+7
source

At the Xcode target point

set the 'Debug information Formate' to DWARF.

Create Debug Symbols: Yes

Debugging debugging characters while copying: YES

See image for more information. In the final download, make sure you return it. This is for testing. enter image description here

+1
source

To do this, you need to create the dYSM file that was created when the distribution assembly was created.

The link below may help you ..

IPhone crash character reports on iPhone

+1
source

All Articles