Hi,
I am working for the iOS CI build environment dev/maint.
Since Xcode 14.2 has released, our CI users started claiming that their builds often fail because watchOS 9.1 simulators are not found
.
ex1)
xcodebuild: error: Failed to build workspace YWeatherApp with scheme YWeatherApp.
Reason: This scheme builds an embedded Apple Watch app. watchOS 9.1 must be installed in order to archive the scheme
Recovery suggestion: watchOS 9.1 is not installed. To use with Xcode, first download and install the platform
ex2)
xcodebuild: error: Unable to find a destination matching the provided destination specifier:
{ platform:watchOS Simulator, id:CF9011C4-9FD7-40F3-A2A9-46B8D593B2FD }
Ineligible destinations for the "Swinject-watchOS" scheme:
{ platform:watchOS, id:dvtdevice-DVTiOSDevicePlaceholder-watchos:placeholder, name:Any watchOS Device, error:watchOS 9.1 is not installed. To use with Xcode, first download and install the platform }
But when I execute simctl list
command to see if there is watchOS 9.1 simruntime and simulator devices, sometimes it shows as available but sometimes it doesn't.
the result of xcrun simctl list when watchOS 9.1 simulators are unavailable
the result of xcrun simctl list when watchOS 9.1 simulators are available
Same machine (Mac mini Intel Late 2018), 30 minutes term between command executions.
What is weird when error: the runtime profile of watchOS 9.1 apparently exist at the top, but the devices of watchOS 9.1 shows on and off as available... and the reason of unavailability is: (unavailable, runtime profile not found)
.
What we do for Xcode 14.x installation with watchOS/tvOS simulators is: sudo xcodebuild -runFirstLaunch
and sudo xcodebuild -downloadAllPlatforms
after each installation of Xcode 14.x.
What we do after each build job ends is: pkill -9 Simulator
, pkill update_dyld_sim_shared_cache
, pkill -9 update_dyld_sim_shared_cache
and launchctl remove com.apple.CoreSimulator.CoreSimulatorService
if the simulator process still exists in ps aux
list.
What I know now as Xcode 14 issue is what is written in the Xcode 14 Known issues for the simulator but Cleanse all simruntimes, Reboot mac and Reinstall the simulators to use
could not be the answer this time because we are running over 60 macs in the system and there are 40 more macs incoming, avg 2000 builds per day.
Is there anything wrong what we are doing in the operations?
and would there be any alternative solutions or suggestions for this situation?
Thanks in advance.