change of behavior of "xcrun simctl create" with macOS 13.3 / Xcode 14.3

I've been using a shell script for several years, to reset / create the list of simulators I use with my projects.

It's simply a bunch of calls of "xcrun simctl delete" and "create", with the proper simulators and sdk identifiers.

With the last update of macOS 13.3 and Xcode 14.3, the behavior has changed. The simulators are properly created, I can see them in the "Devices and Simulators" window. But they don't show anymore in the Xcode "run destination" dropdown menu (except, surprisingly, two of them, always the same).

After having try and understand the reason for a long time, I saw that if I change the value of "Show run destination" field, from "Automatic" to "Always" in the "Devices and Simulators" window, THEN the simulator shows in the dropdown menu.

Did someone noticed the same effect ? Do someone know if I can control this field value from the "xcun simctl" command ?

thank you all for any information, cheers, loïc b.

I'm having the same issue -- pretty annoying considering we frequently delete and recreate simulators to have wiped, fresh simulators for snapshot testing :|

I don't love this, but I found a workaround if you happen to be creating your simulators via xcrun simctl:

defaults write com.apple.dt.Xcode DVTDeviceVisibilityPreferences -dict-add "$(xcrun simctl create "iPhone 8 Plus" "iPhone 8 Plus" com.apple.CoreSimulator.SimRuntime.iOS-16-0)" 1

This takes the resulting UUID from creating an iPhone 8 Plus simulator with xcrun, and adds it to the dictionary as Always shown. If you're creating simulators automatically, you can adjust your script to automatically change the behavior such that they're always shown. I found I had to restart Xcode after generating the simulators in order to see them as run destinations...

If you want to clear the preferences before adding new keys, you can run the following command beforehand:

defaults write com.apple.dt.Xcode DVTDeviceVisibilityPreferences -dict

change of behavior of "xcrun simctl create" with macOS 13.3 / Xcode 14.3
 
 
Q