Skip to content

Instantly share code, notes, and snippets.

@dokimyj
Last active September 21, 2023 09:10
Show Gist options
  • Save dokimyj/9a77cca9fb627a0ae51264a1fe329733 to your computer and use it in GitHub Desktop.
Save dokimyj/9a77cca9fb627a0ae51264a1fe329733 to your computer and use it in GitHub Desktop.
As I read Bazel Xcode 14.2 watchOS 9.1 simulator runtime issues...
https://github.com/bazelbuild/continuous-integration/issues/1431
I found an interesting issue for Xcode 14.2 CI installation on Bazel Org.
I can't advise because I really have no idea what exactly they suffer from and I'm too noob...
But as a CI maintainer, hope this gist can help whoever is facing the same problem as I did.
※ Really useful article written by English speaker would be: https://macops.ca/xcode-14-new-platforms-packaging-format/
Thanks a lot for the information, macops.ca!
============================================================================
Before Xcode 14.x released, Xcode bundled all SDKs and Simulators as default. (macOS 11.x, iOS 15.x, tvOS 15.x, watchOS 8.x)
From Xcode 14, Apple bundled only macOS and iOS simulators as default.
If you need to install tvOS16.x and watchOS 9.x at the same time, you should execute the command below:
`/path/to/xcode.app/Contents/Developer/usr/bin/xcodebuild -downloadAllPlatforms`
If you want to choose the additional simulator to be installed, you should execute the command below:
`/path/to/xcode.app/Contents/Developer/usr/bin/xcodebuild -downloadPlatform watchOS` (`tvOS` instead of `watchOS` if needed)
From Xcode 15 beta, Apple separated all simulators except macOS from Xcode.
Also, If you have used `sudo` for `xcodebuild -downloadAllPlatforms`, you should stop from Xcode 15 beta installation.
If not, you will see everlasting `Finding Content...` log till SIGKILL.
Info of simruntimes installed by `xcodebuild -downloadAllPlatforms`:
- Runtimes installed will be mounted at the mountpoint of `/Library/Developer/CoreSimulator/Volumes`.
- If you want to check the simdiskimages status, execute `df -h | grep CoreSimulator`.
- The location of the simruntime image files: `/Library/Developer/CoreSimulator/Images/<Simulator Runtime UUID>.dmg`
- `/Library/Developer/CoreSimulator/Images/images.plist` would be renewed if any changes of simruntime occur.
- If you want to check all simruntimes at once, execute `DEVELOPER_DIR=/path/to/xcode.app xcrun simctl runtime list`.
- If you want to delete a simruntime clearly, execute `DEVELOPER_DIR=/path/to/xcode.app xcrun simctl runtime delete <Simulator Runtime UUID>`.
- For more information, type `DEVELOPER_DIR=/path/to/xcode.app xcrun simctl runtime help`.
- Tips for simulator runtime selection
- See what runtime is selected for current Xcode: `xcrun simctl runtime match list`
- Select which runtime to use for the Xcode selected: `xcrun simctl runtime match set '<SDK name and version>' <canonical name>`
- ex1) watchOS 9.1 to latest downloadble: `xcrun simctl runtime match set 'watchos9.1' 20S75`
- ex2) tvOS 16.1 to latest downloadable: `xcrun simctl runtime match set 'appletvos16.1' 20K67`
- ex3) iOS 17 to beta 2 `xcrun simctl runtime match set 'iphoneos17.0' 21A5268h`
- Setting to default: `xcrun simctl runtime match set 'xxxxxxosX.X' --default`
- What's happening in Xcode 14.1 and 14.2
- Sometimes watchOS 9.1 simulator runtime becomes unavailable with no clue
- It is because the default simruntime is set as `20S71`, which can never be downloaded anymore. (as you know, it should be 20S75.)
- ↑ can be checked by `xcrun simctl runtime match set 'watchos9.1' --default` with Xcode 14.2 as xcode-select path.
- Execute `xcrun simctl runtime match set 'watchos9.1' 20S75` on every build launch and see if errs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment