Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone sdk read crash files programmatically?

I want to read crash files programmatically. How can I do this?

I am allowed to do this? Will my application be rejected if I do this?

Any advice, link, tutorial is well come.

like image 800
Alex Terente Avatar asked Jan 19 '23 19:01

Alex Terente


1 Answers

I am not sure if its possible. You can’t access the logs themselves, but you can catch uncaught exceptions and generate your own crash logs for which I think you can make use of the following example: http://cocoawithlove.com/2010/05/handling-unhandled-exceptions-and.html

it's very simple and easy to use, just register exception and signal handlers using:

NSSetUncaughtExceptionHandler(&HandleException);
signal(SIGABRT, SignalHandler);
signal(SIGILL, SignalHandler);
signal(SIGSEGV, SignalHandler);
signal(SIGFPE, SignalHandler);
signal(SIGBUS, SignalHandler);
signal(SIGPIPE, SignalHandler);

and get the stack trace using the backtrace method in UncaughtExceptionHandler class.

like image 104
visakh7 Avatar answered Jan 31 '23 14:01

visakh7