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)

@saagar Did you ever find out if this works for real development?

With that defaults write command on my Intel Mac, I'm able to pair my Vision Pro with Xcode and compile apps, but I can't get them onto the device! The paired Vision Pro refuses to appear as a run destination in the dropdown. I've been pulling my hair out all day now.

I'd love to know if something is wrong with my setup or if this is an Intel limitation. (Which would also suck since I don't have access to an Apple Silicon Mac.)

@Wowfunhappy I haven’t looked at it, sorry. I have an Apple silicon machine personally and only run CI builds on Intel (or did, anyways–GitHub offers new runners now). Do you get an error of some sort?
@saagar No error. Thanks, just thought I'd ask if you heard anything.
@Wowfunhappy Unfortunately not. I’m sure there is a way to enable it but I haven’t looked into it
@saagar Now do "how to compile for intel on arm using mac ports" please... 😉
@jann Is this not just a flag that you can set