I wrote an app for visionOS and I decided I want to add iOS and iPadOS support for the app. I added iPad and iPhone for supported destinations, but when I try to build it via the iPhone or iPad simulator, I get error:
Building for 'iphonesimulator', but realitytool only supports [xros, xrsimulator]
Nothing in my code is specific to visionOS and I can't see anything mentioning realitytool. I've tried messing around with build architecture settings, but nothing seems to work.
I faced the same issue when trying to port a visionOS-only app to iPhone and iPad. This is because you need to modify the build phases of your target so that it only loads RealityKitContent when on visionOS, not on iOS. Here's how to fix it:
Next, you'll likely have different build errors, like "No such module 'RealityKitContent'". To fix this, you'll want to replace the import statement from
to