Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Crash Reporter for Cocoa app [closed]

I'm working on a Cocoa app targeting Leopard and above, and I'm thinking about adding a crash reporter to it (I'd like to think my app won't crash, but let's get real here). I have some mostly conceptual questions before I really get started.

1) How does this work conceptually, knowing when there's a crash and bringing up a reporter? Do I have a daemon running looking for a crash, or do I wait until my app is launched next time to report?

2) Can this be done in Cocoa? Or would I have to dip into Carbon or IOKit or somesuch?

3) Is this even a good idea? Mac OS X already has a built in crash reporter, but as a developer I don't get to see the crash logs. I don't think my app will be crashing often, frankly, but I just don't want to be naive but this sort of thing.

What are your thoughts and opinions regarding this?

like image 688
jbrennan Avatar asked Jul 10 '09 17:07

jbrennan


People also ask

What is Exc_breakpoint crash?

EXC_BREAKPOINT (SIGTRAP) and EXC_BAD_INSTRUCTION (SIGILL)The breakpoint exception type indicates a trace trap interrupted the process. A trace trap gives an attached debugger the chance to interrupt the process at a specific point in its execution. On ARM processors, this appears as EXC_BREAKPOINT (SIGTRAP).


2 Answers

I've had a lot of success with UKCrashReporter. The code is straighforward and easy to modify to match the L&F of your app.

PLCrashReporter looks interesting, though.

I'd stay away from Smart Crash Reporter just because many users (rightfully) don't appreciate your app injecting code into unexpected places and it strikes me as a fragile (perhaps dangerous to use in a released app) approach.

like image 174
Barry Wark Avatar answered Oct 26 '22 15:10

Barry Wark


Others have answered the question well and pointed to some good example code.

Coding it yourself is fairly simple. The strategy generally is:

  • catch appropriate signals
  • launch a separate crash reporter app that lives inside your application's bundle
  • the crash reporter app then finds the latest crash log entry for your app and sends it to you via whatever method you desire (POST, email, etc)
like image 28
wadesworld Avatar answered Oct 26 '22 14:10

wadesworld