-
Re: Testing App State Saving/Restoration without Xcode Connected?
eskimo Nov 30, 2016 1:27 AM (in response to 3DTOPO)But when I try to kill the backgrounded app (by double tapping the home button and swiping the app up off the screen), then the app state is not restored when relaunched.
ISTR that removing the app from the multitasking UI specifically disables state restoration, on the grounds that the user only does this when there’s something wrong with the app and thus it’s better to start from a clean slate.
How can I quit out of the app without Xcode so that it will restore its' state?
Have you tried calling
exit
? It’s definitely not OK to do this in production code (see QA1561) but it’s fine to use while testing.Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardwarelet myEmail = "eskimo" + "1" + "@apple.com"
-
Re: Testing App State Saving/Restoration without Xcode Connected?
3DTOPO Nov 30, 2016 2:35 PM (in response to eskimo)Thank you for confirming that is the expected behavior.
So, I take it there is no way to exit the app and save the state other than calling exit? I wanted to provide instructions to beta testers how to test the app's restoration, but adding a 'exit' button is less than ideal.
-
Re: Testing App State Saving/Restoration without Xcode Connected?
KMT Nov 30, 2016 5:11 PM (in response to 3DTOPO)Try doing an ad-hoc install....they sometimes better replicate a store install, as an example, vs. debug when Xcode connected.
-
Re: Testing App State Saving/Restoration without Xcode Connected?
eskimo Dec 1, 2016 1:03 AM (in response to 3DTOPO)I wanted to provide instructions to beta testers how to test the app's restoration, but adding a 'exit' button is less than ideal.
Quite. I misinterpreted what you meant by “testing”. I assumed you were talking about in-house testing but you’re actually talking about beta testing. Having an Exit button is definitely not appropriate for beta testers.
In terms of purely user-level options, the ones that spring to mind are:
Restart the phone
Update the app
Run a bunch of resource hungry apps, which results in the system kicking your app out of memory
At a code level you could do the
exit
when the app is in the background, perhaps using some statistical model so that sometimes it exists and sometimes it does. However, there’s two risks with adding code like this:You have to make sure that the code gets disabled in your production build.
It introduces a behaviour difference between your beta test build and production build, which is something you generally want to avoid.
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardwarelet myEmail = "eskimo" + "1" + "@apple.com"
-
-