XCode using GUID instead of iOS version number in Simulator Selection
Asked Answered
S

3

37

Somewhere during the various updates of XCode in the last month, the iOS versions dropped from my simulator selection (image below.) Anyone know how to resolve this?

XCode simulators showing GUID not iOS version

Sniper answered 23/10, 2014 at 16:39 Comment(2)
It shows GUIDs to distinguish between multiple simulators with the same device and iOS version. If you delete the dupes in the Devices window, the list will be cleaned up.Grommet
Possible dupe: #26212093Presbyterate
D
52

How to fix it

Xcode uses the device version to disambiguate devices with the same name. If two devices have the same name and version number, it will use the devices' UDIDs.

You have 4 of each of a bunch of devices (eg iPhone 5s). I suspect that some of them are for the same iOS version. You should delete some of the duplicates. Check out xcrun simctl list and xcrun simctl delete or use the device manager within Xcode.app (click on the "-" to delete a device).

How to just get back to a default state

# Ensure all possible clients of CoreSimulatorService are no longer running:

killall Xcode 2> /dev/null
killall Instruments 2> /dev/null
killall 'iOS Simulator' 2> /dev/null
killall Simulator 2> /dev/null
killall 'Simulator (Watch)' 2> /dev/null
killall ibtoold 2> /dev/null
killall simctl 2> /dev/null
# There may be others

# Kill the service itself
sudo killall -9 com.apple.CoreSimulator.CoreSimulatorService

# Remove all the data and logs
rm -rf ~/Library/*/CoreSimulator

Why this might be happening:

CoreSimulatorService will monitor for the addition of new simulator runtimes in /Library/Developer/CoreSimulator/Profiles (eg, for when downloading them from Xcode -> Preferences -> Downloads). When installing a new runtime, CoreSimulatorService will create an initial set of devices for that runtime.

This problem arrises if there are multiple instances of CoreSimulatorService running at the same time. Each CoreSimulatorService instance will create its own set of devices (but its clients will only see that instances's sets at first). On subsequent launches (eg: after a reboot), both copies will be seen. One can get into a state where multiple copies of CoreSimulatorService are running at the same time due to testing beta versions of Xcode.app in the same login session as using the released Xcode.app or by having used Xcode.app before and after updating it through the App Store.

If you are aware of any other way that this bug might come about, please file a new radar at http://bugreport.apple.com

Disconnection answered 24/10, 2014 at 1:54 Comment(1)
I'd add that it is easy to add simulators back with the (+) button, so don't worry to much about deleting the wrong one(s) (unless you have important data on the simulator that you want to save).Izanami
D
17

Deleting multiple copies of the same version from the Devices window did the trick for me.

Drome answered 2/7, 2015 at 18:12 Comment(1)
This does answer the question "Anyone know how to resolve this?" While Kijit Desai doesn't hypothesize about why multiple same-version simulators are appearing, the most straightforward answer (all from within Xcode itself) method to resolve this situation is indeed to delete the duplicate-versioned-sims from Xcode's Devices window.Amber
C
3

I found this script to be the most efficient. I clears the list of existing simulators, than rebuilds it based on installed platforms.

See https://gist.github.com/cabeca/cbaacbeb6a1cc4683aa5

Caveator answered 7/7, 2015 at 13:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.