I'm trying to achieve some automation for iOS simulators. I'm facing a strange issue that I'm not able to understand. Precisely following is my scenario:
- I create a simulator using command:
xcrun simctl create "iPhone 8 Plus"
- I rename my newly created simulator:
xcrun simctl rename <udid> my-new-iphone-8-plus
- I boot my simulator:
xcrun simctl boot <udid>
- I open the simulator app:
open /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app/
. At this point the simulator app is up and running and I can fully interact with the simulator. - I shutdown the simulator:
xcrun simctl shutdown <udid>
. At this point the simulator gets shutdown but the simulator app is still running, which makes sense because I may be running more than one simulators simultaneously. - I boot the shutdown simulator again:
xcrun simctl boot <udid>
. At this point the simulator launches quickly. Neither the boot screen appears nor any loading indicator, as it appeared the first time I launched it.
At this moment the simulator is not responsive to my touch. It seems like it's stuck. The command returns successfully and doesn't return any errors.
I have tried the same thing using fbsimctl
as well. I faced the same issue. Also tried with multiple simulators.
ONE IMPORTANT THING: When I close the simulator manually by selecting the desired simulator window and then do CMD + W
or close it from the top left red close button and then boot it again from command line it surprisingly works fine.
OBJECTIVE: When the simulator is booted after shutdown using command line, the simulator should be responsive like it was before.
I tried other things as well, like killing process using pid
. It didn't help.
Any help in this regard will be highly appreciated. Thanks!