1

The main idea is to catch the crash log (or the reason of the error) and send it to a server. I know that iTunes does log the crashes from the users' devices but I need to find if there's a way to get it and store it on our server.

I was trying "PlCrashReporter" and i finished implementing it (as they did on this link https://www.plcrashreporter.org/documentation/api/v1.0/example_usage_iphone.html).

Problem

The function applicationDidFinishLaunching is not called when the crash occurs.

Am I on the right track? Is there a specific function which is called upon a crash in AppDelegate ?

Thanks in advance

EDIT

I've also tried the solution of the following question:

iOS crash log catch, debug info.. Catch and send via email to the Dev team

It actually works but there are some errors that are cause by Swift and not Objective-C (Like Error while unwrapping optional value) were not caught..

Any suggestions?

Community
  • 1
  • 1
Odin
  • 642
  • 1
  • 9
  • 27
  • 2
    See also http://stackoverflow.com/questions/14325019/what-cause-info-can-be-readily-collected-in-an-ios-signal-handler – Hot Licks Dec 26 '14 at 15:54
  • 1
    The crash report has to be send on the next app start. That is how PLCrashReporter also suggests to do it. – Kerni Dec 26 '14 at 15:59
  • Is there any way to modify the code of PLCrashReporter to make it send the crash report on crash? @Kerni – Odin Dec 29 '14 at 06:58
  • 1
    It is highly recommended not to even try this, because it puts your users data at high risk for data corruption or even locking the device. Do *not* go that route! – Kerni Dec 29 '14 at 09:50
  • What data specifically? @Kerni – Odin Dec 29 '14 at 09:54
  • 1
    Any data. Your app crashed which means it is in a highly unstable state where no guarantees can be made. E.g. even calling only one Objective-C or Swift method when the app crashed could cause data loss. Here is an article from the author of PLCrashReporter: http://landonf.bikemonkey.org/code/crashreporting/Reliable_Crash_Reporting_1.1.20130119.html I can only repeat myself: don't even think about going that route! – Kerni Dec 29 '14 at 10:30
  • @Odin - Have you found the reason why its not catching those swift runtime errors ? But AFAIK crittercism and all catches this. – Durai Amuthan.H Mar 17 '16 at 12:11
  • I invite you share your thoughts on this question http://stackoverflow.com/q/35557716/730807 – Durai Amuthan.H Mar 17 '16 at 12:11

1 Answers1

3

You should use Crashlytics. You then can use a custom web hook to receive the crash reports.

enter image description here

Moxy
  • 4,162
  • 2
  • 30
  • 49
  • 1
    Thank you for the fast reply.. I will check it asap and will reply my feedback :) @Moxy – Odin Dec 26 '14 at 15:48
  • Crashlytics is beta. I registered in line to get the app but in the mean time is there any alternative? @Moxy – Odin Dec 27 '14 at 07:09
  • Did they tell how much time it could take? You shouldn't reinvent the wheel. There are other services like splunkmint (formerly bugsense) – Moxy Dec 27 '14 at 11:28
  • They didn't mention any time. I guess it's better not to use any beta frameworks to do this. I'll try to find another frameworks @Moxy – Odin Dec 29 '14 at 06:57
  • Crashlytics has existed for years and is not in beta! They have a feature called beta that lets you have beta users like testflight. – Moxy Dec 29 '14 at 11:44