How can I try ?
You can exercise the ‘force quit’ case in the obvious way: by using the multitasking UI to force quit your app.
You can exercise the ‘app was terminated by the system for other reasons’ case by calling
exitwhile your app is in the background. One approach I use runs something like this:
when the app goes to the background, start a UIApplication background task (to prevent the app from being suspended) and a timer (for 30 seconds or so)
when the timer fires, call
exitto terminate your app
trigger a location change and watch your app being relaunched
exitis fine for testing but don’t do it in your customer builds.
Share and Enjoy
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"