Is there way to get the stack trace of an iOS device that running your app? - ios

I have an iOS app that I side-loaded to 5 of my testers onto their phones.
1 of them reported that the app is crashing, but I can’t seem to reproduce it.
He also can’t seem to reproduce it either.
Is there way to get the stack trace of an iOS device that running your app?
Is there away that he can sent his logs to me via email or some kind of cloud service like Firebase?
Should I look into any technology?

If you get the person to bring their phone to you, you can plug it in to XCode and read the logs that way, however, you won't be able to go back and view logs from days past. But, if they plug in and run the app and are able to recreate the crash, then you'll have it right there.
It is possible to write code in your app to write log data to a file that you save on your phone. To keep from filling up your phone storage, I delete that file when the app is closed and create it new when the app is started. Then, I created a method in the app to contact support, and I attach the log file to the e-mail. This works great as long as they click the contact support button before closing out of the app. However, if the app crashes, then you could code it to keep the log file if it already exists on the next startup.
Keep in mind that once you start sending the log data to a file, it will no longer show up in your console when you are debugging your app, unless you code some sort of easy switch to flip to turn that feature on or off.

Related

How to make a request to a server when the iOS 9 app is closed?

Good day. I've been reading a lot about this problem and there are many SO questions for previous versions of iOS.
I'm wondering, for iOS 9, Can I somehow send data to the server (a request with about 20-30kbs of payload data) if the app is not opened (So it wasn't started or was force-quit)?
Or is this still a no-go as of iOS 9.3?
I can go without even receiving the response from the server (i'm that desperate)
We have been fighting with similar requirements for a long time. But we finally decided not to do it.
Apple suggests to do only a quick state log of your app so you can restore the same state when you open the app again. The best thing to do when the app is about to go to background is, to write something on disk which might be useful when the app loads again.
We tried connecting to the server every time user takes the app to background, but we saw a lot of app crash issues after adding this code. Coz, the OS force quits the app if its taking time to goto background.
We finally decided to store whatever info on the disk and then send it to server next time the app is open.

How do you access the all of the NSLog statements?

I have an application which is producing an error very intermittently, I am trying to run it down with an NSLog statement in swift. However, after I have noticed the bug has occured, when I hook up my iPhone to review the logs in the Devices window. I only see about 5 minutes worth of statements from various applications. Is there a way to get the history past what automatically comes up? Is there a way to get your applications NSLog statements only?
I haven't tried it from Swift, but we sometimes use NSLogger from Obj-C. It will log to a local Mac application instead of the console on the device. Alternatively, we sometimes log to a file and then transfer the file via email.
You can take a look at Bugfender, it's a product we have built to solve this problem. We had the same problem, especially when delivering beta apps to our customers, so we decided to make a product to solve this problem.
With Bugfender you will be able to get the device logs without any need to connect the device to your computer.
It's easy to integrate and you can choose which devices you want to get the logs from. Our service works offline and online, we have spent a lot of time to make it reliable and easy to use.

Access to iOS device's console output

Is there an iOS app which allows to look at console output created by another iOS app?
My app has several NSLog() calls which output precise timings. I would like to test the app, when it is not connected to my development Mac, and look at timings after that, possibly still on my iDevice using some other "console browser" app.
Is that possible?
So the way to do this is to use the Apple System Logger which allows you to access the logs and you can then display them on screen. NSLog will be logged to this. I wrote something a few years ago so that testers could test the app and open the log and view it on the device.
Its a bit tricky to use the interface and there is a limit, I think it was 200, on the number of logs in the cache, so log only the necessary stuff.
After a quick search, I found this - SOLogger which should help you.

How to debug an iOS app that does not make it past launch for certain users?

I have hundreds of people using my app, but a handful are reporting that the app does not make it past the black launch screen (it immediately closes, before entering into my app). I'm using Crittercism but it's not even getting far enough to catch any exception, which makes it sound like a springboard / backboard problem.
Here's what I've asked the users to do:
Reinstall the app
Delete some apps (to free some space)
Restart the device
None of the above worked. I'm completely at a loss as to what's wrong. The app is in the AppStore and works fine for most users. Furthermore, I can't find anything unique about these users (they're using recent versions of iOS with fairly modern hardware).
Crittercism doesn't show anything, because after the crash - log will be send only at the next launch, so if user doesn't open your app anymore (or can't do it, because he has constant crash).
I advice your to try next ideas:
Do use use keychain or store smth there? It's not cleared after uninstall
Maybe your data is backed up in icloud
Did it begin with the new iOs version (9.0 for example)
Maybe it's some cache problem after installing one version on another,
Can it be the problem of different timezones
Can it be a crash with local settings
If you have feedback with users with crash - contact them and ask about device, iOs version and other
your have crash sections in your itunesconnect profile, maybe there you'll get some information

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