If you’re doing CI on Intel machines but need to build for visionOS:

defaults write com.apple.dt.Xcode AllowUnsupportedVisionOSHost -bool YES
defaults write com.apple.CoreSimulator AllowUnsupportedVisionOSHost -bool YES

(Run this before xcodebuild -downloadPlatform visionOS)
I have no idea whether this actually works for real development but I needed it for GitHub Actions, because those run on Intel by default. I would venture a guess at “yes” because this is enabled on Apple internal builds and they are stingy with hardware refreshes for engineers
@saagar Really thanks for sharing, you saved my some hours (I credited it to you, please tell me if you dont like it https://github.com/cinderella-project/iMast/commit/19839be383574380438893044738d32eeaff57b1 )
ci: Use matrix to parallel build and add workaround for visionOS on GHA · cinderella-project/iMast@19839be

📱🐘 3rd-party Mastodon Client for iOS. Contribute to cinderella-project/iMast development by creating an account on GitHub.

GitHub
@rinsuki Works for me, glad it was useful

@saagar fyi: GitHub finally releases Apple Silicon CI for public repositoires, and it includes visionOS simulator. all you need is change `macOS-13` to `macOS-14`

ref. https://github.blog/changelog/2024-01-30-github-actions-introducing-the-new-m1-macos-runner-available-to-open-source/

GitHub Actions: Introducing the new M1 macOS runner available to open source!

GitHub Actions: Introducing the new M1 macOS runner available to open source!

The GitHub Blog
@rinsuki wtf I just spent four hours out of seven waiting on CI downloading the visionOS simulator last weekend
@rinsuki My macOS CI has gone from 70 seconds → 40 seconds and my visionOS build (which used to take 400 seconds) now takes the same amount of time as the macOS one
@saagar me too (nearly 2x times faster), reminds me to first time of running Xcode on my first Apple Silicon Mac (in my case that was M1 Max MBP, not DTK)