In long test runs, we're seeing situations where the emulator fails to shut down from driver.quit, leaving a booted simulator running in the background. Subsequent tests all fail to launch the emulator due to:
"2016-09-27 09:35:32:148 - [iOSSim] Simulator not shut down: iPhone 6 (undefined, udid: 148C4D52-B03F-4781-BF69-CF0043B49C33) is still in state 'booted'"
It's unclear what puts the simulator in this state, or why appium fails to quit the driver on client().quit() and stop all the the simulator processes.
In any case, it seems like appium should kill instruments/simulators during the simulator launch/retry loop, rather than giving up when it detects an emulator that isn't shut down.
N/A
You can see a failed AppiumDriver.deleteSession(), then the fialure to shut down the simulator by appium. This is followed by relaunch of appium (this is handled in our test code) and another failure due to the persisted emulator from previous.
https://gist.github.com/vicwomg/88e3e37bc1e2790d19d1fe830afb35a3
Have not found a way to reliably reproduce
As a workaround you can try to kill the Simulator and its daemon using _killall_ before starting the driver:
killall Simulator launchd_sim ids_simd configd_sim xpcproxy_sim
Closed as obsolete
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
As a workaround you can try to kill the Simulator and its daemon using _killall_ before starting the driver: