I'm planning out a game that requires multiple users and I was wondering if there's a way to fire up multiple instances of the iPhone Simulator. I didn't see anything in menus or in Google search results, but I just wanted to make sure I wasn't missing anything.
-
1I tried duplicating the iPhone Simulator.app but it wouldn't let me. – ceejayoz May 22 '09 at 06:21
-
1Ivsti's answer is basically correct and you should accept that as the answer. The script at http://www.coderebel.com/2010/08/31/iphone_simulator works fine i.e. allows you to run one simulator per user. – twerdster Jun 12 '11 at 17:31
-
It's possible but usually not worth the trouble. Better to use 1 simulator + 1 (or more) devices. Usually easy to get a few (older/broken) devices for super cheap on craigslist, and use them. – blueberryfields Sep 04 '12 at 15:02
-
1It is possible, without any fuzz. See http://stackoverflow.com/questions/26446346/xcode6-run-two-instances-of-the-simulator/26446438?noredirect=1#comment41535712_26446438 – vintagexav Dec 08 '14 at 20:24
-
1A better solution is shown below here https://stackoverflow.com/questions/896487/is-there-a-way-to-simulate-multiple-iphones-using-xcode-iphone-sim/30607358#30607358 The selected answer should be updated – Just a coder Jun 02 '15 at 22:16
10 Answers
It is possible but only with multiple users.
Read this: http://www.coderebel.com/2010/08/31/iphone_simulator
Assuming you have two projects (P1,P2) which you want to debug simultaneously, do as follows.
Steps to set up:
- Create a new user (U2) on your Mac
- Give it R/W access to P2, especially to its build folder.
- Download the launcher app from the site above and copy it to Applications.
Steps to debug:
- Close Xcode and the simulator if running
- Launch the iPhone Launcher.app with U1.
- Start Xcode with U1, load P1, start debugging.
- Launch the iPhone Launcher.app with U2.
- Start Xcode with U2, load P2, start debugging.
Unfortunately it's a P.I.T.A. having to change users every now and then but so far I haven't found any better solution. Hope this helps.

- 611
- 1
- 5
- 2
There is a way to do this easily without using multiple users. Keep in mind you will not be connected to the debugger though. Keep in mind the explanation below is for XCode 6+. You can skip this explanation and just scroll down to the wrapping-it-up section below.
From an answer here we can see that you can launch any simulator from command line:
open -a "iOS Simulator" --args -CurrentDeviceUDID
You can find the deviceID (as well as all your simulators) by running the xcrun simctl list
command on console. It will generate a list like this. The device ID is the code in braces:
== Runtimes ==
iOS 8.3 (8.3 - 12F69) (com.apple.CoreSimulator.SimRuntime.iOS-8-3)
== Devices ==
-- iOS 8.3 --
iPhone 4s (99Z06AC6-A2D6-46E7-B4F7-BA4F5F3F39C8) (Shutdown)
iPhone 5 (K262AF11-ADD2-4FDA-ACBA-8C80DD9D4AA1) (Shutdown)
iPhone 5s (337KDC51-0A4B-47DB-8966-83562FD92C93) (Shutdown)
iPhone 6 Plus (9GK714E2-F713-4F98-A96E-C72ACD6571A8) (Shutdown)
-- iOS 8.2 --
etc continued....
Therefore to run the simulator using above as example, run this command on console:
open -n /Applications/Xcode.app/Contents/Developer/Applications/iOS\ Simulator.app/ --args -CurrentDeviceUDID '99Z06AC6-A2D6-46E7-B4F7-BA4F5F3F39C8'
We use the -n
flag instead because the -a
flag specifies the application to use for opening the file, while the -n
flag opens a new instance of the application(s) even if one is already running. Use the man open
command to know all this stuff.
Also make sure you have the correct path for your simulator.
One more thing to note, if you run the simulator like this, chances are that you have limited simulators. And since its limited, you might want to launch it without interrupting one that's already on the screen. We can solve this from this answer here where he shows you how to create a new simulator and delete one.
So wrapping it all up, here's what you do to launch them.
A) First Create a simulator before launching it.
Usage: simctl create "name" "device type id" "runtime id"
xcrun simctl create "mynewsimulator" "iPhone 6" "com.apple.CoreSimulator.SimRuntime.iOS-8-3"
You will find the runtime id from the command xcrun simctl list
command I ran above. After running the above command, the deviceID will be printed on the console screen. Take note of it as you will need as the last argument to launch the simulator shown below. Let's assume this ID was 99Z06AC6-A2D6-46E7-B4F7-BA4F5F3F39C8
B) launch it
open -n /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app/ --args -CurrentDeviceUDID '99Z06AC6-A2D6-46E7-B4F7-BA4F5F3F39C8'
C) delete it once you're finished with your simulator
xcrun simctl delete 99Z06AC6-A2D6-46E7-B4F7-BA4F5F3F39C8
All this can be placed in a single .sh file for easy running.
Please note to put wait
or sleep
commands after each command if you decide to put all this into a sh file.
[EDIT 2017] I see that XCode 9 will now support multiple simulators. Awaiting to see how it will all work.

- 15,480
- 16
- 85
- 138
-
-
hmm. There is also code to close the simulator. But its been an while since i've posted this solution. I cant find it right now. – Just a coder Sep 23 '16 at 16:47
As near as I can tell, not only can you not have multiple instances of the simulator running, but when time comes for actual device testing you can't have multiple instances of the debugger running either.
This means to do multi-device apps, you'll need to have a single Mac assigned to a single iPhone/touch device (or simulator instance) each running your app.
I've started looking into whether VMWare or Parallels can somehow be brought into this, but there's not much that can be done without hacking the OS.
I suggest filing a feature request with http://bugreporter.apple.com.

- 13,343
- 3
- 33
- 35
-
-
15You can run as much devices as you want, the problem is just the simulator. – João Nunes Jan 21 '13 at 15:55
-
3This might be a feature added in some XCode version after this question was answered, but only for reference in case other people are looking: XCode 5 allows you to have multiple instances of the debugger running. – Cutetare Nov 27 '13 at 02:26
Another option (albeit probably overkill) if you have a Mac OS X server license is to virtualize an instance of Mac OS X Server, and run a second simulator in the VM.

- 23,892
- 18
- 70
- 90
I managed to get it to work combining answer by Ivsty with this one.
Basically, what you do is create two users (A and B), run simulators in each of them, run VNC server on user B, and then connect from user A to access screen B without needing to switch users.

- 1
- 1

- 170
- 2
- 11
Follow these steps to test your app.
You have to do one thing for whole process first : Go to Project - > Edit Project Settings -> tick on option - Build independent targets in parallel.
- Debug code that will create your app in simulator For Example your App name is - Instance
- Close Simulator
- Go to Project->New Target -> Instance2 Add "Bundle display name : Instance2" in Instance2.info.plist file Set Executable Name : Instance2 Select Instance2 Target -> Go to Project -> Set Active Target -> Instance2 Build with Instance2
Note : Do all carefully otherwise you have to reset your simulator For Reset Simulator -> Run Simulator -> iPhone Simulator -> Reset Content & Settings...
Now You have two apps in simulator and you can test app on all instance.
Hope it will help you :)

- 35,607
- 26
- 136
- 135

- 41
- 2
Hmm...I don't think you are missing anything here. As far as I know there is no technology within the SDK that is able to emulate multiple devices -- though that would be a useful feature to have. I think your only options would be to get a second iPhone OS device, or get a friend who also has an iPhone OS device to let you use it for testing.

- 14,002
- 33
- 96
- 136
In XCode 4 you can run multiple instances while having both be in debug mode.
What I did was create a duplicate of my target and ran both the original and the duplicate. If you're using the output window you can toggle which output you are looking at.

- 3,810
- 6
- 32
- 63
-
At the time, nearly 3 years ago, the answer that I chose was correct. I'll try your out when I get home tonight and give you credit if it works out. :) – Abel Mar 06 '12 at 21:40
-
No worries, just figured I'd update the question for the current state of things. I actually had to do it just yesterday because I needed to run two simulations at once. – erik Mar 07 '12 at 16:07
-
1Apparently does not work with iOS Simulator. Get error "Simulator can't be launched because it is already in use." – Kekoa Jun 19 '12 at 16:37
Yes, now it's possible and is also quite easy.
The only thing you need is xctool
, the build tools from Facebook and a ruby gem. The ruby gem helps to create/destroy the simulator needed during the test.
You can read the full documentation on this link:
https://github.com/plu/parallel_ios_tests
I'm using this approach and I run my test on 4 iOS simulator on the same time.

- 4,554
- 4
- 33
- 46