How to Run Multiple iOS Simulators at Once

How to run multiple simulators on Xcode 9?

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.

how to run two simulators on xcode 11?

You need to use File>Open Device to open a new Simulator in the Xcode 11 Simulator app.

You can only run an app from Xcode on 1 simulator at a time. However, you can install the app on 2 different simulators, then you can manually launch it on one of the 2 (or both).

How to run multiple simulators on Xcode 12 and 13?

In order to open another simulator, you'll need to go to File > Open Simulator and then choose from the devices there like this:

Screenshot of Mac's menu bar: File > Open Simulator > iOS 14.5 > iPhone Xs

You're all set! I just want to share this to everyone to help save their time and avoid getting headaches (like what I've experienced) just to run another simulator on Mac.

How to run Flutter app on multiple iOS simulators at the same time?

There's a known issue in the Flutter SDK where it uses Xcode's latest build system, which prohibits the concurrent builds to run with a single flutter run command.

If you want to test your app against multiple devices at the same time, run the following:

  • flutter devices
  • flutter run -d <device_id_iphone> && flutter run -d <device_id_ipad>

The catch for this workaround is you have two isolated Flutter app instances running.

If you're running them on the command line, you have to reload each instance individually.

Can I run my Expo app on multiple iOS Simulators at once?

This command:

expo-cli ios

does not let you choose the actual simulator on which it should run.

Assuming the Expo viewer app is installed and default ports are used, this command allows you to open it on a specific simulator:

xcrun simctl openurl <some-device-id> exp://127.0.0.1:19000

Run Expo on Multiple Simulators

It can be run on multiple simulators at once.

Since it's a bit cumbersome to restart the selected simulators from scratch every day, here's a small shell script that automatically starts three specific simulators based on their device IDs and opens the Expo application on them:

#!/bin/bash
declare -a simulators=("0FAE2F92-9EF7-4C4A-8F9D-097A056F8CC0" "BFCDD662-E4DE-4C08-9DF6-CAACA7C00CEC" "1A6959A0-C10F-474B-96C5-7E8955FBDD80")

for i in "${simulators[@]}"
do
xcrun instruments -w $i
#xcrun simctl install $i ~/.expo/ios-simulator-app-cache/Exponent-2.14.0.app
xcrun simctl openurl $i exp://127.0.0.1:19000
done

Here you can see three different simulator device IDs in an array. Of course you have to use your own device IDs of the simulators you want to use.

BTW: if you once installed the Exponent-x.x.x.app it is available in a hidden folder in your home directory. So by calling:

xcrun simctl install <some-device-id> ~/.expo/ios-simulator-app-cache/Exponent-2.14.0.app

you can even install the Expo app in a specific simulator (see also the commented line in the shell script above) from the command line.

NOTE: The Exponent-2.14.0.app version will change as the Expo SDK is upgraded. Exponent-2.14.0.app comes with expo-cli --version 3.13.1, which is current as of February 22, 2020.

How to Determine the Simulator IDs

xcrun simctl list

This displays the corresponding device ID for each simulator.

A small note: Over time, there are several simulator entries that are no longer available after an upgrade. To remove them with a simple command, proceed as follows:

xcrun simctl delete unavailable

Demo

Here is a short demo of the script:

  • three simulators are started
  • the Expo app is opened

The source code of the demo app is then changed. All three simulators are updated at once.

demo of multiple iOS simulators

How do I run Flutter in multiple iOS Simulators

Ok, apparently iOS Simulators are not regarded as flutter emulators. For the life of me, I could not find any documentation regarding this so here it goes.

The iOS Simulator can be run with flutter emulators --launch apple_ios_simulator

After launching this when you run flutter devices it will appear as a device.

3 connected devices:

iPhone 11 • DCDA3304-2E80-4BCD-B0D5-968C2EBD2FA3 • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-5 (simulator)
Web Server • web-server • web-javascript • Flutter Tools
Chrome • chrome • web-javascript • Google Chrome 83.0.4103.61

Then just run another simulator via the Simulator app

Sample Image

Run flutter devices once again to check if another iOS Simulator device has showed up

4 connected devices:

iPhone 11 • DCDA3304-2E80-4BCD-B0D5-968C2EBD2FA3 • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-5 (simulator)
iPhone SE (2nd generation) • 59D9A787-E68B-4CE1-8CDB-2A5D3CBF0093 • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-5 (simulator)
Web Server • web-server • web-javascript • Flutter Tools
Chrome • chrome • web-javascript • Google Chrome 83.0.4103.61

And from there you can just run flutter run -d all.

Running multiple iOS simulators with React Native?

Using MacOs Terminal, launch first simulator:

  1. cd /Applications/Xcode.app/Contents/Developer/Applications
  2. open -n Simulator.app
  3. cd <your react native project>
  4. react-native run-ios

Now, launch 2nd simulator:


  1. cd /Applications/Xcode.app/Contents/Developer/Applications
  2. open -n Simulator.app
  3. Click "Ok" when you get "Unable to boot device in current state"
  4. Change simulator to be different than first simulator (e.g. Hardware -> Device -> iPhone 6s)
  5. cd <react-native project>
  6. react-native run-ios --simulator "iPhone 6s" (or whatever simulator you chose in step 8).

Note: In the last step, you can disregard the terminal output since it indicates that it is launching using the 1st simulator hardware. In fact, it is launching into the 2nd simulator (as desired).

Is it possible to debug with multiple simulators at the same time without stopping the previous tasks?

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

Then, choose your model on Xcode.

https://help.apple.com/simulator/mac/9.0/index.html?localePath=en.lproj#/devd856f9e4c

More description available here.

NOTE : Till now , its not possible to debug in both simulators at the same time. You can only check UI , if you add a new simulator the instance of previous will be ended.

Is there a way to run multiple iOS Simulators at once?

AFAICT, it does not support multiple instances running at the same time.

I tried two methods, but both failed.

$ open -n /Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app
LSOpenURLsWithRole() failed with error -10829 for the file /Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone Simulator.app.

Using an alias (http://forums.creativecow.net/thread/71/860074) brings up a dailog box saying "Only one iOS Simulator can run at a time. Please quit iOS Simulator and try again."



Related Topics



Leave a reply



Submit