Repository navigation
feat(XR): add visionOS Simulator UIKit header overlay - #77
Merged
Merged
Conversation
Add install_xr_uikit_overlay.sh, which generates a clang and swift VFS overlay that replaces UIScreen.h, UIWindow.h, and UIDevice.h of the selected XRSimulator SDK with copies that allow UIScreen, UIWindow.screen, and UIDevice.orientation on visionOS. The SDK inside Xcode stays unchanged. The --sdk option also writes a UIKit-only additions SDK for projects that use ADDITIONAL_SDKS. Move the header patch logic into patch_uikit_headers.sh with verification, and keep enable_uiscreen_support.sh as a wrapper for the internal SDK installer. Document the overlay in the README and mark the XRSimulator internal SDK path as legacy.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The public visionOS Simulator SDK marks
UIScreen,UIWindow.screen, andUIDevice.orientationunavailable, although UIKit implements them at runtime. AddScripts/XR/install_xr_uikit_overlay.sh, which copiesUIScreen.h,UIWindow.h, andUIDevice.hfrom the selected XRSimulator SDK, removes those restrictions, and writes a clang and swift VFS overlay to~/Library/Developer/OpenSwiftUI/XRSimulator. Projects use it through-ivfsoverlayand-vfsoverlayforxrsimulator; the SDK inside Xcode stays unchanged. The--sdkoption also writes a UIKit-only additions SDK for projects that useADDITIONAL_SDKS.The header patch logic moves to
Scripts/XR/patch_uikit_headers.sh, which checks that every expected restriction was removed.enable_uiscreen_support.shremains as a wrapper forinstall_internal_sdk.sh XRSimulator. The README documents the overlay and marks the XRSimulator internal SDK path as legacy.Verified with Xcode 26.6 and the visionOS 2.5 Simulator: OpenSwiftUI builds for
generic/platform=visionOS Simulator(arm64 and x86_64) and its HostingExample runs. The patch also applies to the Xcode 16.4 and 27.0 headers.