11

I am currently working on code to log a user's behavior in the app and to report crashes and the sequence leading up to them. I have one big problem, I do not know how to make my app detect if it has crashed. Does anybody know how to do this in swift? Your help would be much appreciated!

Pang
  • 9,564
  • 146
  • 81
  • 122
Stewart Hering
  • 304
  • 4
  • 14
  • A post that discusses several other approaches can be found here: https://stackoverflow.com/questions/37220379/swift-natively-detect-if-app-has-crashed – CristianMoisei Feb 04 '20 at 06:25

1 Answers1

2

I don't think there is currently a way to do this. When your app crashes it ceases to function and all processes stop. Usually any crash and diagnostic data is sent via the user settings panel.

Edit: There is an helpful post here: https://stackoverflow.com/a/8242215/4891259

Hope that helps.

Community
  • 1
  • 1
Warve
  • 481
  • 1
  • 8
  • 22
  • 1
    I know the app stops working when it crashes. What I'm looking to do is log certain things as the app is running and then on event of a rash send those logs to a specific place weather it be a server or a an email. Is this possible? – Stewart Hering Jul 23 '15 at 16:56
  • You would have to build a data model and bind that to each action. – Warve Jul 23 '15 at 18:49
  • Yes, it is possible with SwiftyBeaver Logger. Check at Github (https://github.com/SwiftyBeaver/SwiftyBeaver) and signup at https://swiftybeaver.com to detect & catch logs during release – Sebastian Apr 29 '16 at 06:26