0

I am testing the behavior of my app concerning the enforced timeout of iOS which stops any app at latest 3 minutes after it has been killed by the user. It is very tedious to wait for this timeout whenever I want to check my functionality. Does anybody know if it is possible to reduce this timeout for testing purposes?

[Edit]

To sum up the comments below: I am trying to make my app run forever in background as described here and also be able to be reanimated after the user or iOS has killed it. In order to check this, I actually have to kill the app, let it be reanimated, and then see if it survives the 3-minute time limit of iOS.

My current "test cycle" is:
1) Deploying the app
2) Killing it manually with double-click and swiping it away
3) Activating flight mode
4) Deactivating flight mode (to force a significant location change which restarts the app)
5) Waiting for three minutes to see if the app survives.

How would I shorten the 3-minute timeout of step 5?

Community
  • 1
  • 1
mikey
  • 161
  • 9
  • If you're doing it on a simulator, you might be able to change the system clock right after you start the test? Just a guess. – i_am_jorf Jan 11 '17 at 21:25
  • Are you just trying to test the `applicationWillTerminate(_:)` method in the `AppDelegate`? You can still force close an app with the simulator. – Pierce Jan 11 '17 at 21:43
  • Actually I am trying to make my app run forever in background as described here (http://stackoverflow.com/a/36194283/1195688). This relies on location updates. Hence, I need to run it on a real phone :( – mikey Jan 11 '17 at 21:51
  • Are you trying to test the completion handler when the background time expires, or just testing that the app is fired up again when the location updates trigger it? The former is hard to get around, but for the latter you can just programmatically kill your app (but don't stop it via the double-tap on home technique)... – Rob Jan 12 '17 at 00:47
  • My current "test cycle" is: 1) Deploying the app, 2) Killing it manually with double-click and swiping it away, 3) Activating flight mode, 4) Deactivating flight mode (to force a significant location change which restarts the app), 5) Waiting for three minutes to see if the app survives. I hope you can feel my pain while reading these lines... – mikey Jan 12 '17 at 19:24

0 Answers0