iOS simulator force quit app causes simulator shutdown

It’s always been clear that when you force quit your app on the ios sim, it is expected behavior for appium to exit. I have always assumed this was appium doing the detection of the app dying, then appium exiting, but now I’m seeing that it’s in fact Instruments that is detecting this and exiting the simulator. Is this (Instruments is the one exiting) correct? And is it also correct to say that there is nothing that we (users or core Appium team) can do to prevent this?

reset function will relaunch app on Simulator if you need it.

I have used reset() on Android, and it appears to have a similar effect on iOS, which is to uninstall and reinstall the app. What I was really hoping though, was to force quit the app on the iOS simulator, then restart the app by swiping right to left and tapping the app’s name on iOS Springboard using a device x,y tap

If you set capabilities fullReset: false, and noReset: true, then reset function will simply relaunch the app, because in fact, reset is just reinitialization of the driver.

hello, I think I may have a simular problem to solve when I understand this discussion right.
I am leaving during my test my App by clicking the Home button. Now I want to get back to my app, its on the second home screen page. How can I swipe there by coordinates or how can I just resume the App? Or even better quit the app completly and launch it again?
Could you provide me some code on how to use resume()?
Edit: sorry I read wrong, reset()!

No kidding… had never tried that before. This is interesting, but I have 2 issues with it:
-I’m not completely convinced that this simulates a hardware force quit/relaunch closely enough to claim we’re covering that test case (though it’s certainly better than nothing)
-Most of my test cases that involve force quit are of the form a)force quit b)take some action c)relaunch the app, so it looks like I will still not be able to cover those.

Thank you very much though, I will be setting these caps this way for ios now…

Jules - Maybe a simpler answer would be to do a double-tap on the home button, then tap your app, either by its name, or just by tapping in the middle of the screen if it consistently appears in the middle of the screen

1 Like