Adds support for VisionOS in UnityHub in macos#710
Adds support for VisionOS in UnityHub in macos#710webbertakken merged 4 commits intogame-ci:mainfrom
Conversation
📝 WalkthroughWalkthroughThe changes introduce support for the "VisionOS" platform. This includes adding "VisionOS" as a recognized platform type, updating image tag logic to handle a new "visionos" suffix with macOS build enforcement, and modifying macOS setup logic to append the appropriate module argument for VisionOS builds. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Platform
participant ImageTag
participant SetupMac
User->>Platform: Request platform types
Platform-->>User: Returns types including VisionOS
User->>ImageTag: Request platform-to-suffix mapping for VisionOS
ImageTag->>ImageTag: Check if process.platform === 'darwin'
alt Not macOS
ImageTag-->>User: Throw error (VisionOS builds require macOS)
else macOS
ImageTag-->>User: Return "visionos" suffix
end
User->>SetupMac: Request module params for VisionOS
SetupMac-->>User: Append "--module visionos" to params
Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (3)
dist/index.jsis excluded by!**/dist/**dist/index.js.mapis excluded by!**/dist/**,!**/*.mapdist/licenses.txtis excluded by!**/dist/**
📒 Files selected for processing (3)
src/model/image-tag.ts(3 hunks)src/model/platform-setup/setup-mac.ts(1 hunks)src/model/platform.ts(1 hunks)
🔇 Additional comments (4)
src/model/platform.ts (1)
19-19: LGTM! Clean platform type addition.The VisionOS platform type is correctly added following the established naming convention and logical placement among Apple platforms.
src/model/platform-setup/setup-mac.ts (1)
106-108:Details
✅ Verification successful
LGTM! Consistent module parameter implementation.
The VisionOS module parameter follows the established pattern with lowercase naming convention, consistent with other Apple platforms (ios, tvos).
Verify that Unity Hub uses 'visionos' as the module identifier:
🌐 Web query:
What is the correct Unity Hub module identifier for VisionOS platform support?💡 Result:
To develop applications for Apple's visionOS platform using Unity, you need to install the visionOS module through Unity Hub. This module is available for Unity Editor versions 2022.3.5f1 and later. (docs.unity3d.com)
To install the visionOS module:
- Open Unity Hub.
- Navigate to the 'Installs' tab.
- Click on the three dots next to your desired Unity Editor version and select 'Add Modules'.
- In the list of available modules, check the box for 'visionOS Build Support'.
- Click 'Done' to begin the installation.
Once installed, you can create or configure projects for visionOS by selecting the 'visionOS' platform in the Build Settings. For more detailed instructions, refer to Unity's official documentation on visionOS. (docs.unity3d.com)
Citations:
- 1: https://docs.unity3d.com/6000.0/Documentation/Manual/visionOS.html?utm_source=openai
- 2: https://docs.unity3d.com/6000.0/Documentation/Manual/visionOS.html?utm_source=openai
Approved: Verified Unity Hub module identifier ‘visionos’
Confirmed via Unity’s documentation that the VisionOS build-support module is identified as “visionos” (shown in the Hub UI as “visionOS Build Support”), matching the lowercase pattern used for other Apple platforms. No further changes needed.
src/model/image-tag.ts (2)
61-61: LGTM! Proper suffix addition.The visionos suffix follows the established lowercase naming convention consistent with other Apple platforms.
86-100: LGTM! Necessary destructuring update.The destructuring properly includes the new visionos suffix for use in the platform mapping logic.
| case Platform.types.VisionOS: | ||
| if (process.platform !== 'darwin') { | ||
| throw new Error(`visionOS can only be built on a macOS base OS`); | ||
| } | ||
|
|
||
| return visionos; |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
LGTM! Correct platform validation for VisionOS.
The implementation properly enforces macOS-only builds for VisionOS using process.platform === 'darwin', which is appropriate for Apple's visionOS platform. The error message is clear and informative.
Note: There appears to be an inconsistency in the existing tvOS validation logic (lines 152-157) where it checks !== 'win32' but claims tvOS can only be built on Windows. This seems like a pre-existing issue unrelated to your changes, but you may want to verify the correct platform requirements for tvOS builds.
🌐 Web query:
What are the correct platform requirements for building tvOS applications in Unity? Can tvOS be built on Windows or does it require macOS like other Apple platforms?
💡 Result:
To build tvOS applications in Unity, you need to consider the platform requirements:
-
Development Platform:
- While you can develop your Unity project on Windows, you cannot build the final tvOS application entirely on Windows.
- tvOS development requires Xcode for the final build and signing process. Xcode is only available on macOS.
-
Building and Deployment:
- You must use a macOS machine to build the tvOS application from Unity.
- The process typically involves exporting your Unity project to an Xcode project and then using Xcode to compile, sign, and deploy the app to a tvOS device or the Apple TV simulator.
-
Unity Support:
- Unity supports tvOS as a build target, but the build process integrates with Xcode, which enforces the need for macOS.
Summary:
- You can develop and do much of the work on Windows.
- You must have access to macOS with Xcode installed to build, sign, and submit tvOS applications.
This is similar to other Apple platforms (iOS, macOS, watchOS) which also require macOS for final building and submission through Xcode.
Fix tvOS platform validation
The VisionOS check on lines 158–163 is correct, but the existing tvOS logic still enforces Windows-only builds. Unity tvOS targets also require Xcode on macOS and cannot be fully built on Windows.
Please update src/model/image-tag.ts around lines 152–157:
- Change the tvOS platform guard to check for
process.platform !== 'darwin' - Update the error message to reflect macOS requirement
Suggested diff:
case Platform.types.TVOS:
- if (process.platform !== 'win32') {
- throw new Error(`tvOS can only be built on Windows`);
- }
+ if (process.platform !== 'darwin') {
+ throw new Error(`tvOS can only be built on a macOS base OS`);
+ }
return tvos;Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In src/model/image-tag.ts around lines 152 to 157, the tvOS platform validation
incorrectly checks for Windows platform and restricts builds to Windows, but
tvOS builds require macOS with Xcode. Update the condition to check if
process.platform is not 'darwin' and change the error message to indicate that
tvOS can only be built on a macOS base OS, aligning it with the VisionOS
validation logic.
# Conflicts: # dist/index.js.map
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #710 +/- ##
==========================================
- Coverage 37.12% 37.07% -0.05%
==========================================
Files 77 77
Lines 3157 3161 +4
Branches 623 625 +2
==========================================
Hits 1172 1172
- Misses 1985 1989 +4
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/model/image-tag.ts (1)
158-163: LGTM! Proper platform validation for VisionOS with test coverage gap.The implementation correctly enforces macOS-only builds for VisionOS using
process.platform === 'darwin', which aligns with Apple platform requirements. The error message is clear and informative.However, the static analysis indicates these lines lack test coverage. Consider adding unit tests to validate:
- VisionOS builds succeed on macOS (
process.platform === 'darwin')- VisionOS builds fail with appropriate error on non-macOS platforms
- Correct return value (
visionossuffix)// Example test case structure: describe('VisionOS platform validation', () => { it('should allow VisionOS builds on macOS', () => { // Test logic here }); it('should reject VisionOS builds on non-macOS platforms', () => { // Test logic here }); });🧰 Tools
🪛 GitHub Check: codecov/patch
[warning] 158-158: src/model/image-tag.ts#L158
Added line #L158 was not covered by tests
[warning] 160-160: src/model/image-tag.ts#L160
Added line #L160 was not covered by tests
[warning] 163-163: src/model/image-tag.ts#L163
Added line #L163 was not covered by tests
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
dist/index.jsis excluded by!**/dist/**dist/index.js.mapis excluded by!**/dist/**,!**/*.map
📒 Files selected for processing (2)
src/model/image-tag.ts(3 hunks)src/model/platform-setup/setup-mac.ts(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- src/model/platform-setup/setup-mac.ts
🧰 Additional context used
🪛 GitHub Check: codecov/patch
src/model/image-tag.ts
[warning] 158-158: src/model/image-tag.ts#L158
Added line #L158 was not covered by tests
[warning] 160-160: src/model/image-tag.ts#L160
Added line #L160 was not covered by tests
[warning] 163-163: src/model/image-tag.ts#L163
Added line #L163 was not covered by tests
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Tests
🔇 Additional comments (2)
src/model/image-tag.ts (2)
61-61: LGTM! Correct suffix mapping for VisionOS.The
visionossuffix is properly added to the target platform suffixes, maintaining consistency with other Apple platforms.
86-100: LGTM! Destructuring assignment updated correctly.The addition of
visionosto the destructuring assignment maintains consistency with the expandedtargetPlatformSuffixesobject.
|
Released in v4.6.0 |

Changes
Successful Workflow Run Link
From my personal plugin repository, here is a job, using my fork, that successfully export a VisionOS Xcodeproj
https://github.com/lupidan/apple-signin-unity/actions/runs/15509847075
Checklist
code of conduct
in the documentation repo)
Summary by CodeRabbit