66

Till yesterday, everything was normal with Xcode. It was showing simulators as :

enter image description here

But today, when I opened it, simulator list changed to :

enter image description here

Every simulator can be seen twice, name followed by a unique id. I have also observed that same named Simulator are also two different instances.

Can anyone help me, how to get rid of this ? Or how to reset it. It gives a weird look.

Any suggestion will be helpful.

itsji10dra
  • 4,603
  • 3
  • 39
  • 59

9 Answers9

69

Solution from sunnyxx's weibo:

1.quit Xcode and iOS Simulator

2.killall -9 com.apple.CoreSimulator.CoreSimulatorService

3.rm -rf ~/Library/Developer/CoreSimulator/Devices

4.reopen Xcode

Edit: sudo seems unnecessary to kill SimulatorService.This solution will remove all exist simulator and recreate all available version and type simulators.

NSDeveloper
  • 1,630
  • 15
  • 25
67

I have an easier way to fix this.

Run the following:

xcrun simctl list devices | grep -v '^[-=]' | cut -d "(" -f2 | cut -d ")" -f1 | xargs -I {} xcrun simctl delete "{}"
Doz
  • 7,009
  • 12
  • 61
  • 69
15

You can use the following command :

snapshot reset_simulators

If you don't already have snapshot installed :

sudo gem install snapshot.

More info on snapshot here : https://github.com/krausefx/snapshot#installation

Alexis C.
  • 4,898
  • 1
  • 31
  • 43
  • [fastlane](https://github.com/fastlane/fastlane) is a great command line tool set. To reset to needed version, you need `snapshot reset_simulators --ios 8.3,9.1`, [just create latest version by default,see issue 2493](https://github.com/fastlane/fastlane/issues/2493). – NSDeveloper Mar 28 '16 at 02:58
12

Looks like a ton of simulators were split into separate devices when updating. So what it sounds like you'd like to do is reduce your list of output decides.

To view the list of simulators, on the menu bar, goto: Window > Devices. Here you will see all the simulators shown in your output list. There is no reason to not delete and start over by adding the simulators you want

ErickES7
  • 558
  • 6
  • 16
  • 5
    Doesn't really help to solve the problem. The simulators get duplicated again the next time I launch Xcode. Daily routine to delete simulators until I just give up. – honcheng Jul 23 '15 at 14:32
  • You should try uninstalling Xcode, delete any files that was created by Xcode, like the Developer Folder inside your library as well as the iPhone Simulator folder then reinstall. That's odd that there's something continuously adding simulators D: – ErickES7 Jul 23 '15 at 14:43
8

Go to the terminal to see the list of simulators using:

xcrun simctl list

Use the id's to delete the duplicates using:

xcrun simctl delete <ID>

E.g.

xcrun simctl delete 4B645F13-D130-412D-8EB4-B49BE7E2D7DA
tobiasdm
  • 9,688
  • 1
  • 18
  • 15
7

Fixed it by going into Menu->Window->Devices and removing the duplicates (if you see multiple simulators for iPhone 6 for example remove all but one).

Cherpak Evgeny
  • 2,659
  • 22
  • 29
7

Doz's oneliner is good, but the part that extracts the UUID of them simulator fails on some iPad devices like 'iPad Pro (12.9 inch)' because they have parentheses in the name. I rewrote to use grep instead of cut to account for this:

xcrun simctl list devices | grep -o '[A-F0-9]\{8\}-[A-F0-9]\{4\}-[A-F0-9]\{4\}-[A-F0-9]\{4\}-[A-F0-9]\{12\}' | xargs -I {} xcrun simctl delete "{}"
Brad The App Guy
  • 16,255
  • 2
  • 41
  • 60
2

I ended up creating a script to remove Xcode simulator duplicates:

https://gist.github.com/buscarini/6ec0ef1385f47fdbc505

José Manuel Sánchez
  • 5,215
  • 2
  • 31
  • 24
0

If anyone is still coming here in 2022, the easiest solution to delete all simulators is to run this in your command line:

    xcrun simctl delete all

Then just add the simulators you actually want to use.

ms217
  • 40
  • 6