Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Including custom data into iOS crash dumps

Hello Stack Overflow !

A simple question for you : is it possible to embed custom error data into automatically generated iOS crash dumps I get from my users when my app crashed on their device ?

For example : My SQlite database won't operate for some reason (say, the database file is corrupted).. I cannot recover from this error, so I throw an exception, and embed in the exception the detailed sqlite error message. The problem is, the crash dump of the application won't contain the exception message, so it's not easy to know under which conditions the application crashed.

Does anyone know a way to put things into the crash dump report ? Or do you have any other recommended way of reporting production crashes to the developper ?

Thanks !

like image 362
Shtong Avatar asked Dec 13 '11 12:12

Shtong


People also ask

What is a Crashreporter_key?

CrashReporter Key: An anonymized per-device identifier. So other than allowing the tools to link a specific report to a specific device for the purpose of debugging a specific app, it means nothing.

What tool is used to record crash logs iOS?

Firebase Crashlytics Crashlytics is a crash reporting tool that allows you to monitor your iOS applications. Thanks to its huge success, Google acquired it in 2017 and integrated it into its Firebase mobile development platform.


2 Answers

No, you cannot ad your own data into the crash reports. It is also not possible to access iOS generated crash reports automatically because of the sandbox.

So my suggestion is as follows:

  1. For logging your own data, use Cocoalumberjack. It is much faster than NSLog or other logging frameworks out there and has an option to log your messages into a file. Now when an exception occurs, or whenever else you want to, log that into a file. But if your app crashes right at a point where you add something into a log file, it most likely will be missing, since the app crashed the very same moment.

    So its rather impossible to safely catch the exact SQL statement. But the crash report should give you enough information to understand what is happening, with the addition to what you logged of being done before. E.g. you could log the search string used in the SQL way before the SQL is being executed.

    In general try not to log too much.

  2. For catching crash report you should nothing else than a solution based on the open source framework PLCrashReporter, which can safely catch crashes, also when you app is already in the app store! Exception catching is not recommended, check this article to see why!

    iTunes Connect offers you to view some crash reports too, but it takes up to 2 weeks to see some, but by far not all as e.g. pointed out by the Camera+ developers. So you better use your own solution.

    PLCrashReporter will send you standard apple formatted crash reports, ready for symbolication, so you know where the crash happens in your code, including line numbers.

    Some solutions based on PLCrashReporter are:

    • QuincyKit: Open Source client + php server, basic crash grouping, symbolication can be automated from your mac (I am the developer of this)
    • HockeyApp: Paid service, uses QuincyKit client, advanced crash grouping, symbolication fully done on the server (I am on of the developers of this)
    • Bugsense: Free service, symbolication announced as premium feature
    • AppBlade: Paid service, symbolication unknown
    • Crashlytics: Private beta, unknown features, their solution seems to be based on PLCrashReporter
  3. The proposed solutions either allow sending the data automatically on the next startup or by asking the user if he/she agrees to send.

like image 104
Kerni Avatar answered Oct 05 '22 17:10

Kerni


Disclaimer-as-per-the-faq: I am a developer for AppBlade.

AppBlade allows you to send custom parameters along with symbolicated crash reports as of December 2012.

Check it out! http://blog.appblade.com/news/2012/12/appblade-sdk-update-sessions-and-queues/

like image 32
Andrew Avatar answered Oct 05 '22 16:10

Andrew