Skip to content

[eas-cli] Resolve ApplePlatform.TV_OS for managed tvOS targets via EXPO_TV#3907

Draft
douglowder wants to merge 2 commits into
mainfrom
doug/eng-22185-bug-in-tvos-eas-builds-when-non-interactive-passed-in
Draft

[eas-cli] Resolve ApplePlatform.TV_OS for managed tvOS targets via EXPO_TV#3907
douglowder wants to merge 2 commits into
mainfrom
doug/eng-22185-bug-in-tvos-eas-builds-when-non-interactive-passed-in

Conversation

@douglowder

@douglowder douglowder commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Why

Non interactive builds were attempting to incorrectly verify tvOS provisioning profiles with settings for the iOS platform.

How

Recognize when EXPO_TV env variable is set, and in that case, set the target platform to tvOS.

Fixes #3905

Test Plan

  • Tested with a real SDK 56 TV project
  • New unit tests added

…PO_TV

resolveManagedProjectTargetsAsync returns targets without buildSettings,
so getApplePlatformFromTarget defaulted to ApplePlatform.IOS for every
managed project. After #3805, non-interactive iOS builds authenticate
with the submission ASC API key and validate the provisioning profile
against Apple, which then filters on the wrong platform and rejects a
valid TVOS_APP_STORE profile as missing — regenerate also picks the
wrong platform.

Detect the @react-native-tvos/config-tv EXPO_TV convention in
resolveManagedProjectTargetsAsync and synthesize
buildSettings.TARGETED_DEVICE_FAMILY=3 on the application target and any
configured app extensions. The lookup checks both the merged env
parameter (which already carries the build profile's env from eas.json
plus any EAS server env vars) and process.env as a fallback, so it
picks up EXPO_TV whether it lives in the eas.json profile, in EAS
server-side environment variables, or in the shell when the user runs
"EXPO_TV=1 eas build ...". Values are matched case-insensitively against
"1" / "true" / "yes".

Every downstream Apple-portal caller (validate, list, create, configure)
already routes through getApplePlatformFromTarget, so populating that
field at the resolver is the single change needed to pick
TVOS_APP_STORE for tvOS managed builds.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@linear-code

linear-code Bot commented Jun 27, 2026

Copy link
Copy Markdown

ENG-22185

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions

Copy link
Copy Markdown

✅ Thank you for adding the changelog entry!

@douglowder douglowder requested review from quinlanj and sjchmiela June 27, 2026 00:47
@codecov

codecov Bot commented Jun 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.05%. Comparing base (efc78f4) to head (8756aa7).

Files with missing lines Patch % Lines
packages/eas-cli/src/project/ios/target.ts 66.67% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3907      +/-   ##
==========================================
+ Coverage   59.05%   59.05%   +0.01%     
==========================================
  Files         935      935              
  Lines       40959    40968       +9     
  Branches     8630     8634       +4     
==========================================
+ Hits        24185    24191       +6     
- Misses      16678    16681       +3     
  Partials       96       96              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Managed tvOS builds wrongly regenerate credentials since eas-cli 20.2.0 – valid tvOS App Store profile reported "does not exist"

1 participant