Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

24 changes: 22 additions & 2 deletions src/model/image-tag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
android: 'android',
ios: 'ios',
tvos: 'appletv',
visionos: 'visionos',
facebook: 'facebook',
};
}
Expand All @@ -82,8 +83,21 @@
version: string,
providerStrategy: string,
): string {
const { generic, webgl, mac, windows, windowsIl2cpp, wsaPlayer, linux, linuxIl2cpp, android, ios, tvos, facebook } =
ImageTag.targetPlatformSuffixes;
const {
generic,
webgl,
mac,
windows,
windowsIl2cpp,
wsaPlayer,
linux,
linuxIl2cpp,
android,
ios,
tvos,
visionos,
facebook,
} = ImageTag.targetPlatformSuffixes;

const [major, minor] = version.split('.').map((digit) => Number(digit));

Expand Down Expand Up @@ -141,6 +155,12 @@
}

return tvos;
case Platform.types.VisionOS:

Check warning on line 158 in src/model/image-tag.ts

View check run for this annotation

Codecov / codecov/patch

src/model/image-tag.ts#L158

Added line #L158 was not covered by tests
if (process.platform !== 'darwin') {
throw new Error(`visionOS can only be built on a macOS base OS`);

Check warning on line 160 in src/model/image-tag.ts

View check run for this annotation

Codecov / codecov/patch

src/model/image-tag.ts#L160

Added line #L160 was not covered by tests
}

return visionos;

Check warning on line 163 in src/model/image-tag.ts

View check run for this annotation

Codecov / codecov/patch

src/model/image-tag.ts#L163

Added line #L163 was not covered by tests
Comment on lines +158 to +163
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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:

  1. 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.
  2. 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.
  3. 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.

case Platform.types.Switch:
return windows;

Expand Down
3 changes: 3 additions & 0 deletions src/model/platform-setup/setup-mac.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ class SetupMac {
case 'tvOS':
moduleArgument.push('--module', 'appletv');
break;
case 'VisionOS':
moduleArgument.push('--module', 'visionos');
break;
case 'StandaloneOSX':
moduleArgument.push('--module', 'mac-il2cpp');
break;
Expand Down
1 change: 1 addition & 0 deletions src/model/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class Platform {
PS4: 'PS4',
XboxOne: 'XboxOne',
tvOS: 'tvOS',
VisionOS: 'VisionOS',
Switch: 'Switch',

// Unsupported
Expand Down
Loading