Xcode 14.1/2 always resets watchos9.1 simulator runtime to 20S71

Hello,

Previously I posted simulator 9.1 runtime not found although it is installed in the system. (https://developer.apple.com/forums/thread/723603)

I found out there is a command xcrun simctl runtime match set to designate simulator runtime for current Xcode.

I also figured out the fact that watchos 9.1 simulator runtimes for Xcode 14.1 and 14.2 always indicate 20S71, which is patched to 20S75 for now.

(We can check downloadable simulators list from https://devimages-cdn.apple.com/downloads/xcode/simulators/index2.dvtdownloadableindex )

$ sudo xcode-select -s /Applications/Xcode/Xcode_14.1.app

$ xcrun simctl runtime match list
== Evaluation Results ==
appletvos16.1:
    SDK Version: 16.1
    SDK Build: 20K67
    Platform: com.apple.platform.appletvos
    Chosen Runtime: tvOS 16.1 (16.1 - 20K67) - com.apple.CoreSimulator.SimRuntime.tvOS-16-1
        User Override: (null)
        Preferred: (null)
        Default: tvOS 16.1 (16.1 - 20K67) - com.apple.CoreSimulator.SimRuntime.tvOS-16-1

iphoneos16.1:
    SDK Version: 16.1
    SDK Build: 20B71
    Platform: com.apple.platform.iphoneos
    Chosen Runtime: iOS 16.1 (16.1 - 20B72) - com.apple.CoreSimulator.SimRuntime.iOS-16-1
        User Override: (null)
        Preferred: (null)
        Default: iOS 16.1 (16.1 - 20B72) - com.apple.CoreSimulator.SimRuntime.iOS-16-1

watchos9.1:
    SDK Version: 9.1
    SDK Build: 20S71
    Platform: com.apple.platform.watchos
    Chosen Runtime: 20S71
        User Override: (null)
        Preferred: (null)
        Default: 20S71
$ xcode-select -p
/Applications/Xcode/Xcode_14.2.app/Contents/Developer

$ xcrun simctl runtime match list
== Evaluation Results ==
appletvos16.1:
    SDK Version: 16.1
    SDK Build: 20K67
    Platform: com.apple.platform.appletvos
    Chosen Runtime: tvOS 16.1 (16.1 - 20K67) - com.apple.CoreSimulator.SimRuntime.tvOS-16-1
        User Override: (null)
        Preferred: (null)
        Default: tvOS 16.1 (16.1 - 20K67) - com.apple.CoreSimulator.SimRuntime.tvOS-16-1

iphoneos16.2:
    SDK Version: 16.2
    SDK Build: 20C52
    Platform: com.apple.platform.iphoneos
    Chosen Runtime: iOS 16.2 (16.2 - 20C52) - com.apple.CoreSimulator.SimRuntime.iOS-16-2
        User Override: (null)
        Preferred: (null)
        Default: iOS 16.2 (16.2 - 20C52) - com.apple.CoreSimulator.SimRuntime.iOS-16-2

watchos9.1:
    SDK Version: 9.1
    SDK Build: 20S71
    Platform: com.apple.platform.watchos
    Chosen Runtime: 20S71
        User Override: (null)
        Preferred: (null)
        Default: 20S71
$ xcode-select -p
/Applications/Xcode/Xcode_14.3.1_Release_Candidate.app/Contents/Developer

$ xcrun simctl runtime match list
== Evaluation Results ==
appletvos16.4:
    SDK Version: 16.4
    SDK Build: 20L489
    Platform: com.apple.platform.appletvos
    Chosen Runtime: 20L489
        User Override: (null)
        Preferred: (null)
        Default: 20L489

iphoneos16.4:
    SDK Version: 16.4
    SDK Build: 20E238
    Platform: com.apple.platform.iphoneos
    Chosen Runtime: iOS 16.4 (16.4 - 20E247) - com.apple.CoreSimulator.SimRuntime.iOS-16-4
        User Override: (null)
        Preferred: (null)
        Default: iOS 16.4 (16.4 - 20E247) - com.apple.CoreSimulator.SimRuntime.iOS-16-4

watchos9.4:
    SDK Version: 9.4
    SDK Build: 20T248
    Platform: com.apple.platform.watchos
    Chosen Runtime: 20T248
        User Override: (null)
        Preferred: (null)
        Default: 20T248

and I assume that the problem I suffered from (watchOS 9.1 not installed error but simulators and runtime already installed in Mac) is recurring because the watchOS runtime for Xcode 14.1/14.2 is frequently returned to default when reset or switch to other versions of Xcode, even though the user forced to choose a certain SDK version.

What I want to know is:

  1. What file does contain the data of xcrun simctl runtime match list ? Where is it?

  2. Is there any reason or factor for runtime to be set to default? I am in the team running macOS as CI server.

  3. Can I use watchOS 9.x Simulator runtimes while using Xcode 14.2, other than 9.1?

Thanks in advance.

I filed FB12403764 but they said it is 'Works as currently designed' with "Please know this is behaving correctly. Both Xcode14.1 and 14.2 are matched with the watchOS 20S71 simulator runtime." comment.

For CI maintainers, this is quite an issue because it frequently fails the build with 'watchOS 9.1 simulator not installed' errors.

(See what happened to Bazel CI in https://github.com/bazelbuild/continuous-integration/issues/1431)

Issue related to this behavior has initially been publicized by Xcodereleases of which I was unnoticed. (https://github.com/xcodereleases/xcodereleases.com/issues/32)

So if you still have 20S71 on your CI build machine macs, beware not to delete those, keep it with care for Xcode 14.2 builds.

If the problem related to watchOS 9.1/tvOS 16.1 simulator persists, check xcrun simctl runtime match help to see how xcrun simctl runtime match set works.

For details, check my gist. https://gist.github.com/dokimyj/9a77cca9fb627a0ae51264a1fe329733

Xcode 14.1/2 always resets watchos9.1 simulator runtime to 20S71
 
 
Q