Diagnosing non-reproduceable bugs? - ios

I've got a very basic, but terribly important and potentially impossible question: how does one go about diagnosing a bug you can't reproduce?
Twice now, I've gotten emails from people asking about app-crashing bugs that I can't reproduce. Non-modified iPhones, current software, tried reinstalling and hard resets, etc. It crashes every time for them, and it works perfectly for me, (not to mention it got approved for the App Store in the first place so I'm clearly not the only one). I had always understood that the consistency of the devices was one of Apple's big selling points for developers, but that also makes it hard to pinpoint what's different about their device from mine...
So, aside from "just keep testing," is there a trick-of-the-trade among programmers for this sort of thing? Some function of the iPhone simulator that lets you test not just different screen sizes but different hardware configurations, etc? Or am I just out of luck, and stuck telling my customer "sorry, it works for me"?
Can anyone share their experiences or suggestions about this?

You should probably start by installing a crash reporting tool like Crashlytics. This may give you the clues you need or at least help you narrow down where to put additional crash logging.

While the iTunes Connect crash reports can be helpful, the crash reporting services like Crittercism are more user-friendly and full-featured. Crittercism has been very helpful in tracking down infrequently-occurring crashes for my apps and can be used no-charge. (I have no association with Crittercism.)

In iTunes Connect you can access crash reports. These crash reports include call stacks that you can symbolicate and then you can see where it actually crashes.
Here is some good instructions for symbolicating: symbolicating-iphone-app-crash-reports

It's important to keep your dsym files from each build & archive safe. You can use them to symbolicate crash reports, to see details of the crash. Users will have to opt in to submitting crash reports though. I think this is a feature of iTunesConnect.

Related

Share iOS app crash report with developer

My boss has an individual Apple developer program. Normally when there are error in his apps, he would just tell me the errors, but lately the errors are too many, so now he just sent me the crash report from Flurry.
The thing is, it is not symbolicated. And when I tried to symbolicate it in my computer, the app is not the same archive with the one sent to Apple, so I didn't get anything. And this also poses a problem when there are many archives.
This symbolicate process is confusing to me. Is there an easy way to find the errors and symbolicate it using my XCode for the apps published using my boss' XCode?
Using flurry or any other way (Apple's own Crash report?)
Thanks a bunch.
There is no way you can pass a core dump to get your hands on it to debug, but there are several tools can help gather the crash report for you.
I am using Crashlytics to collect the crash report, and it will send you email to let you know a new crash happened or a regression, beatiful UI design and already decoded the symbols for you. It's very easy to setup and absorb. Just check it out.
Crashlytics is bundled with Fabric, including many new features you may need in the future.
Apple recently announced its own crash reporting tool, you could also consider. But I am still stick to Crashlytics since there is no reason not to...
If you know the trick, you can decode the symbols on your own, just search how to do it.
I can recommend crashlytics of fabric.io.

Identify Crash log in iOS

We have used several 3rd party crash logs in past like crittercism, Flurry, crashlytics etc. There're some crash logs in which we are not able to get exact crash point. So, do we have any tool available which provides exact crash point ?
OR which is best 3rd party crash log tools in iOS ?
Depending on the type of crash, stack traces may not contain any of your apps code, which is perfectly fine.
Especially when dealing with memory issues, the crash will happen somewhere completely different than where the bug in your application is. You will have to check for the Exception Type information in the crash log and then go from there.
The following documents can help you understand crash reports better:
https://developer.apple.com/library/ios/technotes/tn2151/_index.html
http://www.raywenderlich.com/23704/demystifying-ios-application-crash-logs
You should also use the tools Xcode provides to make sure there are no easy to detect bugs by using the Instruments Leaks tool, use the Analyze build feature in Xcode, or the Address Sanitizer check in Xcode 7.

Generating crash reports on Cocoa Touch apps

That probably sounds a lot worse than it is, but here's my question.
I am dealing with a crash on an actual device, that one of my tester's is using. At the moment, there is no way to discover what is causing the crash. I can not reproduce it on the simulator. However, on the simulator when something crashes I get log info about it in the output window. But I don't want to keep testing with the device connected.
Is it possible to log crash exceptions, etc into a file when things crash. I know certain apps can do it, but I am not sure how?
Any info would be appreciated.
There are generally two ways to do that:
Someone get the tester to send you the crash reports, that iOS created on the device. This is usually too tricky for end users, so the next suggestion works better. That's also why I am not describing how to do that :) But you'll find plenty of documentations on that process.
Integrate a crash reporting library, that catches the crashes and allows you to receive them in various ways. You should not implement your own global crash exception handler, things are just too complex to do it right (even though other people will tell you otherwise). Also crashes caused by exceptions are only one type of crashes.
There are multiple open source libraries out there, the safest one to use is anything based on PLCrashReporter. Most others use private or undocumented iOS APIs, or are not async-safe, which basically means those can destroy app data or make the crash even worse. See this blog post about the topic: http://landonf.bikemonkey.org/code/crashreporting/Reliable_Crash_Reporting_1.1.20130119.html
The following linked answer shows some of the available options on how to add logging to your app and also various options on how to receive crash reports for test version and also once the app is released: Including custom data into iOS crash dumps
If you're open to using a third party service, I use https://www.crashlytics.com. Makes debugging crashes from user devices painless.

good library to generate Detail Crash report for ios app?

Can anyone suggest me what is the best way/procedure/library to include in IOS app before submitting to app store to generate detail Crash Report , without compromising app efficiency.
is iTune connect procedure is reliable ?? Can any one suggest me any good library ?
Here's a good overview of various libraries, I know Crittercism by reputation but it would be worth evaluating for yourself: http://www.jeremyfuller.net/2011/06/the-battle-of-the-ios-crash-reporters/
iTunes Connect has become more and more reliable as time goes on. Their current crash reports are doing the trick for us.
Flurry also has a way of catching exceptions that crash our applications, so that's useful too.

How to get the Crash Log from Apple?

We developed an app, and it works perfectly on several different emulators and devices, not once crashed, but both times we tried submitting to Apple it gets back to us as "2.1 - apps that crash are rejected" (or something).
I cant seem to find the log from them, or any additional infos. Is the crash log available anywhere? Or just ANY info? They only say that it crashed on an iPad 3rd Gen with iOS 6. We ran on a device like that and it didnt crash for us.
Unfortunately, Apple doesn't provide detailed logs of their review process, although crash logs are sometimes provided, as indicated by #jsd in the comments below.
In theory, crash reports get synchronized with iTunes and can be collected by Apple and provided to you via iTunes Connect, but in practice, that rarely works - or only with large delays.
However, you could integrate some Crash Reporting into your App. Here are a few services that allow you to do that without much hassle:
HockeyApp
Crittercism
BugSense
TestFlight
Crash reporting integration in production versions of my apps have been proven to be very helpful, so I'd highly recommend this. Good crash reporting services provide an SDK to be included in your app, and generate symbolicated, readable, ready-to-use crash reports that make tracking bugs very easy.
As for the cause of your app's crash, here are some basic guesses:
Do you use ARC (Automatic Reference Counting)? You should.
Did you run the Static Analyzer in Xcode (Product ➞ Analyze)?
Did you test with different environments (e.g. internet connection via 3G, WiFi or none at all)?
Have you deleted and reinstalled the app on your device, or did you just update it?

Resources