How to capture crashes if the app crashes on launch - ios

I currently have an issue with my app where it's crashing on launch in some cases for some users in the field, but not in-house. In this case, the whole app shuts down before Crashlytics gets a chance to submit its crash report. How do I avoid this? The Crashlytics delegate protocol doesn't seem to support anything useful in this case - I tried turning off the asynchronous submission functionality, but it did not help. What's the best solution to capture crashes that happen immediately on start-up?
Edit: I am talking about capturing crashes from users in the field, not from my own device.

XCode->(Window menu -> Organizer, or Cmd-Shift-2.) Find your device in the left sidebar, then select “device logs”.

A tool for detecting and repairting continuous launch crash of iOS App
https://github.com/liuslevis/GYBootingProtection

Related

how to view crashes that happen during development

Is it possible to view all the crashes that happened on my iOS device while I am building the app ? I've read that it is possible to retrieve crash logs for simulator but would it be possible also for the physical devices we test on ? I had a crash but then the screen went away and I didn't get a chance to see what exactly it was
Yes you can retrieve crash logs from your devices in Xcode from "Devices and Simulators" in the Window menu. Just select the Devices tab and look for the "View Device Logs" button.
Do note that these are low-level crash reports and won't be as helpful as when you can actually catch the crash in an attached debugger.
Apart from this solutions there is one more approach to getting crash logs in other way.
As you are building an app, you install Fabric/Crashlytics, read the following link:
https://fabric.io/kits/ios/crashlytics/install
You have to follow their instructions and setup the SDK in your app.
By installing this you can able to track & repair the crashes on other iOS devices too. I hope this will be an alternative for you.

Crashlytics for iOS does logs crash only when app is opened after the crash

In an iOS Mobile App why does crashlytics log crash and send email, when the iOS app is opened after the crash. This behavior is not consistent when crashlytics is integrated with android app.
Typically after a crash, user will stop using the app and not open it again. As a consequence we end up missing several crashes which happen in iOS.
Mike from Fabric here. The behavior is different on each platform since each platform has different behaviors for exception handling and networking.
On iOS, it's unsafe to send much, if any, data after an exception happens that leads to a crash. The app is a horrible state and the device is also resolving an unexpected situation. If, we or other services, tried to send additional data then, you could run the risk of causing an issue on the entire device which it would require the device to restart. Asking a user to restart their device is a much worse behavior then having them need to relaunch the app.
You are correct that some users may never relaunch the app and those crashes are lost, but in general, we've found most users relaunch the app post-crash.
As #Dev_Tandel said, on Android, other background networking services can be used to try and send the crash report then. We will try to do that, but don't guarantee that a report will be sent until the app is relaunched.

My iOS app every now and then refuses to launch until I reinstall it

I've got an app that uses Core Data that sporadically stops launching so I have to reinstall it using XCode and then it launches again like normal for a while, with all the Core Data information still preserved.
I have seen that an app often stops launching when the target of an app is too low in comparison to the device software version, however this is not so for this app and device (iPhone 6s).
Have you had such an issue before? What do you think could be causing this problem?
There are many, many, many things that could cause an app to fail to launch. You need to narrow things down and collect some data so that you can find out what the problem is and do something about it. Right now you don't even know that it's related to Core Data, you're just guessing.
For a crash on launch, look at the device console and see what messages appear when you try to launch the app and it fails. You can get the device console messages by
Connecting your device to your Mac
Opening Xcode's "Devices" window (cmd-shift-2)
Looking in the bottom half of the window
A better way to watch the console is to use the free iOS Console app.
The problem was that, as mentioned by dan in the comments, the code was being signed for a short period of time (7 days) and so I had to keep re-installing it on the iOS device to keep it working. Thus to keep the app working indefinitely a paid developer account is needed.
Also mentioned in this reddit forum:
https://www.reddit.com/r/jailbreak/comments/4hotx3/news_free_developer_account_installs_reduced_to_7/

User suddenly can't get past launch image screen

A user has reported that my app suddenly won't launch on their device. They sent me a video, and they launch the app, the launch image screen shows for a split second, but then crashes back to the iOS home screen.
The user tried deleting and reinstalling the app with no benefit.
I use Crashlytics, and am not getting any reports of crashes from them (or any other user- although I've seen them in prior versions so I know it's working correctly). I'm also not seeing any crashes in iTunes connect.
I asked the user to send me any crash reports in the Settings Diagnostics section and they said there are none listed for my app.
I have confirmed that their iOS version is supported by my app. (iOS 8.4).
I'm not sure where to go next, and would appreciate any pointers. Sorry for the vague question but I have posted everything that I know about the situation.
Just wanted to provide some closure on this. The user ended up wiping and restoring their device, and it solved the problem. It seems extreme to me but it was their own suggestion and didn't take them long to do. So I'm not sure what caused this but that's one (albeit brute force) way to fix it.

Way to see crash logs for an iOS app outside of an Xcode debugging session?

I have an app where the user needs to login before using it .
to enhance the user experience , the user needs only to login at the first time and each other time the app will not show the login screen but it will show the app [ I am using user default to store his id ]
now I have achieved this but I ran into a bug and the app crashes when I open it after a succeeded login ..
The problem is :
to mimic the scenario where I open the app without the need to login , I had to stop the app [ which means there will be no debugging session ] and then reopen the app ..
What I am asking for :
is there a way to see what causes the bug knowing that I am not running the app in a debugging session ?
Thanks in advance
Can you run your app on a device? If so, you might be able to get the crash data you need from the Devices window, from Xcode.
Xcode -> Window -> Devices.
Select your device, then select View Device Logs.
Here's Apple's page on the subject.
For running in the simulator, you may be able to get the crash data you need from the Console (I've just tried this and seen at least one crash log from my current development).
Here is Apple's page on Testing with the Simulator. From the menu on the left, check out Viewing Crash Logs. Extract from that page...
To view a crash log
Open Console by going to Applications/Utilities/Console in the Finder.
Look for the line in Console that reads “Saved Crash Report for.”
Expand this item using the arrow at the left.
Click Open Report.
You can maybe check: https://try.crashlytics.com/
It's part of the twitter Fabric framework now quite easy to use, and provides good information
Use Hockey app for getting the info regarding the crash logs:
Here is the link to setup the Hockey app in iOS:
http://support.hockeyapp.net/kb/client-integration-ios-mac-os-x/hockeyapp-for-ios
check plcrashreporter : https://code.google.com/p/plcrashreporter/downloads/list
http://plcrashreporter.googlecode.com/svn/tags/plcrashreporter-1.1-beta1/Documentation/API/functions.html
it's very easy to use and
If your application crashes, a crash report will be written. When the application is next run, you may check for a pending crash report, and submit the report to your own HTTP server, send an e-mail, or even introspect the report locally

Resources