Xcode 6.4 showing duplicate 'Simulators' with Unique Id
Asked Answered
N

9

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.

Noheminoil answered 8/7, 2015 at 6:29 Comment(10)
Same here. I deleted the duplicates but that didn't work. Also, it keeps making duplicates; I have now 5 or 6 copies for each simulatorGalah
@josema.vitaminew I also have Xcode 7 Beta installed , do you have ? Can this be because of it. But Xcode 7 behaves normal.Noheminoil
Yes, I have it too. Could be some kind of conflict, not sureGalah
@josema.vitaminew Have you tried Duemuck's answer.Noheminoil
I tried but it didn't work. After a while (maybe when closing and opening Xcode again it shows the duplicates again).Galah
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).Unbeatable
I deleted my answer. Today I didn't have any duplicates, but after some hours they started appearing againGalah
@josema.vitaminew I have deleted them today by going to Windows>Devices. Now I am waiting to see, whether they re-appear or not.Noheminoil
@josema.vitaminew I opened up Xcode today & they are back. Seems like there's no way to get rid of them permanently.Noheminoil
Kind of reminds me of the Contacts app, where one day you have each contact once, then after syncing your iPhone, restoring/etc. you have everyobody twice, then the next time you have everybody four times, etc...Corollary
S
68

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 "{}"
Shirr answered 11/8, 2015 at 18:49 Comment(10)
this was the ideal solution for me. I had about 80-100 simulators and going to each one individually to delete it was a tedious manual process that took too long.Familiar
This deleted ALL my iOS simulators. Now I have none at all. Do not run this command!Logorrhea
@OrionEdwards Just open the Devices Window [cmd] + [Shift] + [2] and you can add the simulators you need.Fortnight
Thank you! Deleting 100 simulators by hand would have been hellMacpherson
@Fortnight You saved me :) I got in the panic like Orion Edwards but now I reloaded simulators I need.Plantain
This really deletes all Simulators so if you have small amount, just use @Cherpak Evgeny's solutionIas
Hmm... I now have no simulators and installing them from the preferences window doesn't do anything :(Risk
Thanks it's working (run command and add simulators from [cmd] + [Shift] + [2] )Schulte
This works well but fails with devices like 'iPad Pro (12.9 inch)' see: https://mcmap.net/q/294867/-xcode-6-4-showing-duplicate-39-simulators-39-with-unique-idMattos
just remove all existing simulators and the device_set.plist file, and Xcode will recreate them for you. as shown by @BlunderbussCompartment
B
70

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.

Blunderbuss answered 17/8, 2015 at 13:48 Comment(7)
Easiest solution of all!Gibson
Works with XCode 8 GM :) Thank youIdea
Worked perfectly with Xcode 8 GM. The only thing I would change above is this. Instead of deleted ~/Library/Developer/CoreSimulator/Devices, move that directory to a back up location. This will allow you to go back to it if something goes awry.Hereto
Worked great with Xcode 8, App Store version. Did not have to reinstall any simulators after following the steps: all "good" sims were still there, and all "unique ID" ones were gone!Vagal
This worked for me in Xcode 8.0, but it seems to do nothing in 8.1.Kirovabad
Works in 9.2, don't forget to kill the service first.Tybalt
In addition to step 2 I needed to do ps -ax, search for any results containing "simulator" and kill those processes tooFritzie
S
68

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 "{}"
Shirr answered 11/8, 2015 at 18:49 Comment(10)
this was the ideal solution for me. I had about 80-100 simulators and going to each one individually to delete it was a tedious manual process that took too long.Familiar
This deleted ALL my iOS simulators. Now I have none at all. Do not run this command!Logorrhea
@OrionEdwards Just open the Devices Window [cmd] + [Shift] + [2] and you can add the simulators you need.Fortnight
Thank you! Deleting 100 simulators by hand would have been hellMacpherson
@Fortnight You saved me :) I got in the panic like Orion Edwards but now I reloaded simulators I need.Plantain
This really deletes all Simulators so if you have small amount, just use @Cherpak Evgeny's solutionIas
Hmm... I now have no simulators and installing them from the preferences window doesn't do anything :(Risk
Thanks it's working (run command and add simulators from [cmd] + [Shift] + [2] )Schulte
This works well but fails with devices like 'iPad Pro (12.9 inch)' see: https://mcmap.net/q/294867/-xcode-6-4-showing-duplicate-39-simulators-39-with-unique-idMattos
just remove all existing simulators and the device_set.plist file, and Xcode will recreate them for you. as shown by @BlunderbussCompartment
M
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

Microbiology answered 20/8, 2015 at 8:5 Comment(1)
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.Blunderbuss
T
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

Tambourine answered 9/7, 2015 at 23:44 Comment(2)
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.Vara
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:Tambourine
W
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
Windhover answered 8/7, 2015 at 15:12 Comment(0)
U
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).

Unbeatable answered 13/7, 2015 at 7:35 Comment(0)
M
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 "{}"
Mattos answered 28/8, 2016 at 5:20 Comment(0)
B
2

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

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

Burkholder answered 13/7, 2015 at 7:8 Comment(5)
I installed Xcode 7 - Beta 3 & now instead of 2 copy of each Simulator, I can see 4 copy with Unique Id. :(Noheminoil
Download the gist and extract. Then run remove_sim_dups.py every time you have duplicatesGalah
What's the "8.4" hard-coded in your script? Does this work only for iOS 8.4? (I have duplicates of manu iOS versions)Corollary
yes, it's only for iOS 8.4. I manually removed the duplicates for other iOS versions and they didn't come back, my problem is only with 8.4Galah
this script didn't work for me, I'd prefer if it just deleted all of them, that should be a simpler scriptPierrette
L
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.

Locomobile answered 11/7, 2022 at 19:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.