Can I turn off Simulator/Emulator after test was done?

Hi.

I want to test on virtual devices and I need to turn off those devices after test is finished.

To do so, I already tried noReset: False.
However, It resets the app as well, but, I don’t want to reset the app data since I logged in to the app.

Is there any capability that can turn off Simulator/Emulator after test was done?
Or should I execute remote shell command to turn off all sim/emulators?

I want something like the following code:
driver.remote_shell('xcrun simctl terminate xxxx')

But what I found is driver.execute_script() or driver.execute() which I cannot turn off virtual devices.

In my experience the Simulators turn off when the test is done. However, if it’s not for you then you could add a script to cleanup, or do a remote shell as you said. Take a look at: xcrun simctl from command line.

Not sure about Emulators as I don’t use them.

1 Like