How To Run Multiple iOS Simulators Simultaneously
Multiple iOS simulators simultaneously
The other day I ran into a feature I wanted to test with multiple iOS simulators at the same time. When running your app through Xcode, you can only open one device at a time. I never had this requirement before so I never really dug deeper but I was happy to find out that you can do this quite painlessly. Despite not being able to do this directly out of Xcode, you can just open another simulator by opening up the Terminal and typing the following commands found through a good Stackoverflow thread:
cd /Applications/Xcode.app/Contents/Developer/Applications
open -n Simulator.app
open -n Simulator.app
Now, opening the second (or third) simulator will open with an error “Unable to boot device in current state: Booted”.
All you need to do to get the second simulator to work at this point is to change the device type of one of the simulators by heading to Hardware > Device > Chosen iOS version > and choose any of the other iOS devices or versions in the list. You can run a single version of any simulator you have installed so potentially you can have a whole tribe of simulator instances running at once.
And there we go! You are now running several instances of an iOS simulator. It’s a very useful method if you want to test some online features of your app or if you want to speed up testing on multiple screen sizes.
Other options
There are quite a few developers that have saved these lines into scripts which we recommend you do if you need to run multiple iOS simulators more often.
Quick search also showed that people have tried to tackle this use case with even bigger guns. Facebook has a public repo on their Github account called FBSimulatorControl which promises a “Mac OS X library for managing, booting and interacting with multiple iOS Simulators simultaneously” which sounds very promising if you need more features. For a simple test case I believe opening the simulator from the terminal or through a script is easy enough.