Send a log to Crashlytics without an app crash Send a log to Crashlytics without an app crash ios ios

Send a log to Crashlytics without an app crash


With the new update from crashlytics you can now use:

[[FIRCrashlytics crashlytics] recordError:error];

And in Swift:

Crashlytics.crashlytics().record(error: error)

You can check the documentation here.


Kinda old question, but now you can use Answers which is part of the Fabric suit (Crashlytics is part of Fabric as well):

enter image description here

Fabric can be found here. And further documentation here.


I tried the below lines and it works like charm. In try-catch block use the below lines in your catch block

@try {// line of code here}@catch (NSException *exception) {NSUncaughtExceptionHandler *handler = NSGetUncaughtExceptionHandler();handler(exception);}

as explained at http://support.crashlytics.com/knowledgebase/articles/222764-can-i-use-a-custom-exception-handler

[UPDATE]

Now in fabric's crashlytics we can use simple function [Crashlytics recordCustomExceptionName:reason:frameArray:] for sending handled exceptions

@try {// line of code here}@catch (NSException *exception) {    NSArray *stack = [exception callStackReturnAddresses];    [[Crashlytics sharedInstance] recordCustomExceptionName: exception.name                                                 reason: exception.reason                                             frameArray: stack];}

as explained athttps://twittercommunity.com/t/crashlytics-ios-how-to-send-non-fatal-exceptions-without-app-crash/34592/32