Show a log submission prompt after an iOS app crash? - ios

I'm quite new to iOS app development, but back when developing desktop applications (both linux and windows), it's quite common to add a "guardian process" to check on the state of the main process and when the application crashes, a prompt is shown to let user choose whether to submit an error log and whether to restart the application.
It seems for Android apps, it's also possible to have a background service to check the state of a main application and when it crashes, a prompt is shown to let the user choose whether to share an error log or not.
Now I wonder if iOS apps can offer a similar functionality. So far it seems the crash reporting tools I'm aware of are just submitting error logs after the app crashed and started again by the user. Is it possible for an iOS app to show a "Your app has crashed, do you want to submit a crash log" prompt when it crashes? Or is this kind of feature simply technical impossible for the iOS platform?

Related

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

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.

How to check if an app is running in iOS device from a mac terminal

I am trying to launch ios app from python script/terminal using ios-deploy. This is a test app so it might crash and need to relaunch multiple times.
I want to check if this app is currently running or not on the connected device, for my relaunch logic to work. But I am kind of stuck here.
I know idevicesyslog which can capture logs and then parsing logs I can check if my app is currently running or not. But isn't there any sophisticated way to just check if an app is currently running or not in device. Xcode/instruments can get the list of processes via GUI in connected device but I want a command line utility so that I can take certain action.
You can check app or debug app using safari.
Open safari.
And If develop option not available on top navigation bar then open preferences of safari and in advance tab tick show develop option in below that screen.

iOS Application hangs up when started from TestFlight or AppStore

I have developed an iOS application, which has signup process. When started in debug the application is working as expected.
When the application is installed trough TestFlight or AppStore the following scenario occurs:
When starting from the application icon on the home screen everything works as expected.
When starting from TestFlight or AppStore via the "Open" button the application hangs after the signup process is successfully completed.
The application can be downloaded from the following URL: https://itunes.apple.com/us/app/treffn-we-make-meeting-up-easy/id1137059844?ls=1&mt=8
The two outcomes can be observed if you reinstall the application. The application doesn't crash so I don't have any crash reports.
I'm looking for a way to simulate such launch in debug so I can trace what is happening or any ideas on what might be causing the issue.
While asking some of friends around. I understood that the Launch Options are providing additional parameters when launching the application directly from the AppStore or trough TestFlight.
I have found a similar question, which helped me solve my issue.
https://stackoverflow.com/a/34118249/1913174
When you are handling the launch options parameter you should always handle only the cases, which matter to you. In all other cases you should allow your application to behave as started from the icon. In my case I'm handling start from push notification and start from Quick Action. I was storing the launch options each time the application was not started from a Quick Action, which lead to the point when I was trying to handle Push Notification data, which didn't existed.

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

App Submission fails but bug cannot be reproduced in debug mode in Corona SDK

We are having this weird issue related to submitting our app on iOS.
Basically when we build ( using developer profile ) and test ( via test flight ) everything works fine as expected even with most extensive test cases.
But when build ( using iOS distribution profile ) and submitted to apple ... in the review process it fails to pass due to a bug which we CANNOT REPRODUCE.
So, my best guess is that the bug/error is only happening in the release build ( probably due to code optimisation ) .. but I can't even know where and what to look for if I can't reproduce ?
I have submitted it the app twice so far ( with possible guess and fix ) and both time it came back with same error.
How do I test or even see the logs using a release build ? ( so far the DTS has been useless in providing any useful information)
/EDITED/
A bit more background info:
This is a game application made with Corona SDK. If you're familiar with corona sdk then you know what a scene is.
So basically,
I have a "home scene" I have an "open" button on my scene.
I click on the open button a spinner shows up->the app reads a json
file->goes to the next scene.
What apple is seeing in the review process is: Upon clicking on the "open button" on "home scene" the spinner shows up and it does not do anything further. Hence, the app is failing to pass apple's review process.
Please note: this only happens in the release mode (that is built with distribution profile) and not in debug mode ( that is built with provisioning profile )... thus I am unable to reproduce.
For starters, if your App was rejected due to a crash, Apple will send you the crash logs. And they'll crash it multiple times and send you multiple logs.
Now then, there are two ways to view crash logs for release build versions of apps.
On your device, open Settings. Choose General > About > Diagnostics & Usage > Diagnostics & Usage Data. This will be a list of files. Some of them should be your crash logs.
If you plug your phone into a computer after a crash, the crash logs are moved on to the computer.
The location is OS-specific.
On Mac OSX: ~/Library/Logs/CrashReporter/MobileDevice/<device name>/
On Win XP: C:\Documents and Settings\Application Data\Apple
computer\Logs\CrashReporter\<device name>\
On Win 7:
C:\Users\AppData\Roaming\Apple
computer\Logs\CrashReporter\MobileDevice\<device name>\
And finally, your IDE almost definitely has a way of browsing the on-device crash logs. I'm not familiar with any non-Xcode IDEs for developing iOS apps so I can't give any specific advice--but look around. Surely there's something.
You should also ask Apple to send you the console log from the run. Problems most likely will show up there.
Secondly, you should test using an AdHoc Distribution profile as well.

Resources