Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run multiple simulators on Xcode 9?

According to What's new on Xcode, Xcode 9 allows us to run multiple instance of simulator.

But what's the way to do this ?

I tried to Build & Run on different models but it Quit the current instance.

like image 786
Kevin Machado Avatar asked Jun 06 '17 08:06

Kevin Machado


People also ask

How do I run multiple simulators?

I personally prefer to use a Multiple Simulators as the trigger simulator. For creating a new simulator, just hit cmd + shift + 2 to open the devices window then select Simulators then name it whatever you want but remember it because it will be used later. I'll call it Multiple Simulators.

How do I open another simulator in Xcode?

The basic way to open a list of simulators is to use Xcode -> Window -> Devices and Simulators. Here you can create and manage all available simulators.

How do I install additional simulators in Xcode?

If you require a different version of the iOS simulator than is provided by your Xcode installation, you can download additional simulators in Xcode. Open Xcode and click Menu > Xcode > Preferences > Select Components, and then choose the simulator version you want to download.

How many simulator instances can run for an instance of the Xcode?

You can run two instances of the iOS simulator from the command line.


2 Answers

I solved my problem, it's "very simple" :]

On the simulator, you must choose a new device from Hardware > Devices. The new instance will starts.

Then, choose your model on Xcode.

Here is the solution.

like image 196
Kevin Machado Avatar answered Sep 20 '22 15:09

Kevin Machado


Xcode allows you to run simulations in parallel (that can communicate with each other as well, if this is part of app functionality), but you cannot run parallel simulations on the same simulated device type (ie, you can't simulate on two iPhone 11 Pros, but your simulations could be, for instance, iPhone 11 Pro Max & iPhone 11 Pro.)

  1. In Xcode, select your first simulation destination platform (Xcode-Product-Destination-select iOS simulator) and run & start a simulation (ie, ⌘B, ⌘R).
  2. In Xcode, do Debug-Detach from <your_app__name>. Your app simulation will continue to run, but Xcode will no longer be connected to it.
  3. Select a different iOS simulator device.
  4. Run & start the second simulation (ie, ⌘B, ⌘R).

I suspect you could detach the second simulation from Xcode also by repeating step 2, and then reattach Xcode to the first instance, for instance if you want the ability to inspect what is happening on either simulated device, but I haven't tried this.

like image 44
Andrew Selby Avatar answered Sep 21 '22 15:09

Andrew Selby