agentleFS
giolaqgiolaq/tv-build-harness/skills/expo-tv-config/SKILL.md

expo-tv-config

Skill4 starsChanged 5 months agoMIT-0View on GitHub

Expo TV configuration: app.json plugins, prebuild settings, platform-specific config for react-native-tvos

The file

We split this skill into the rules it gives an agent

10 rules. About 0 are common, 4 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    After changing app.json (any field).

    line 76
  2. Distinctive:

    After adding or removing a config plugin.

    line 77
  3. Very specific:

    After bumping expo SDK or react-native-tvos.

    line 78
  4. Distinctive:

    After changing the banner or icon.

    line 79
  5. Very specific:

    After changing only JS/TS code in packages/shared-ui or apps/expo-multi-tv/src/.

    line 83
  6. Distinctive:

    After updating a non-native dependency.

    line 84
  7. Distinctive:

    If the user requests a newer SDK, bump deliberately:

    line 98
  8. Very specific:

    Update expo and react-native (the alias to react-native-tvos) in both apps.

    line 99
  9. Very specific:

    Update transitive deps that have SDK constraints (expo-router, expo-font, etc.).

    line 100
  10. Very specific:

    If a plugin update is included in a normal yarn and the agent forgets to prebuild afterward, the build will succeed but the change won't …

    line 145

≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Expo TV configuration

The Expo plugin @react-native-tvos/config-tv is the single switch that makes an Expo app build for TV. Get this wrong and you ship a phone app to a TV launcher. Get it right and most platform-specific config is automatic.

The one environment variable that matters

EXPO_TV=1

This must be set when:

  • Running expo prebuild
  • Running expo run:android or expo run:ios for a TV build
  • Running EAS Build for a TV profile

For harness-driven Android work, prefer expo prebuild followed by the Gradle wrapper and android run. Treat expo run:android as a manual compatibility command because Android CLI should own deployment and launch when available.

Without it, the plugin no-ops and you get a mobile build. The expo_prebuild tool always sets it; if a user invokes prebuild manually, the symptom is silent — the build succeeds but the app is wrong.

A handy .envrc (direnv) or shell alias avoids forgetting:

export EXPO_TV=1

Plugin options

[
  "@react-native-tvos/config-tv",
  {
    "isTV": true,
    "androidTVBanner": "./assets/icon-400x240.png",
    "showVerboseWarnings": false
  }
]
  • isTV: true — required. Drives Android leanback config and tvOS deployment target.
  • androidTVBanner — path to the 400×240 banner. Required for Android TV / Fire TV. See firetv-leanback.md.
  • showVerboseWarnings — verbose prebuild output. Useful when debugging.

What the plugin does (so you know what NOT to do manually)

On Android:

  • Adds <intent-filter> with LEANBACK_LAUNCHER to the main activity
  • Adds <uses-feature android:name="android.software.leanback" android:required="false" />
  • Adds <uses-feature android:name="android.hardware.touchscreen" android:required="false" />
  • References the banner in the application tag

On iOS:

  • Sets deployment target to tvOS
  • Switches the Xcode target to Apple TV
  • Adjusts Info.plist for TV (removes phone-only keys)

This is why you don't edit native files directly. Anything the plugin does, the plugin owns. Manual edits get clobbered on the next prebuild.

Prebuild — when and why

EXPO_TV=1 npx expo prebuild --clean

--clean regenerates ios/ and android/ from scratch. This is what you want in CI and in the harness — reproducible builds. Without --clean, prebuild merges into existing native files and merge conflicts are silent and weird.

When to prebuild

  • After changing app.json (any field).
  • After adding or removing a config plugin.
  • After bumping expo SDK or react-native-tvos.
  • After changing the banner or icon.

When NOT to prebuild

  • After changing only JS/TS code in packages/shared-ui or apps/expo-multi-tv/src/. JS bundles don't require regeneration.
  • After updating a non-native dependency. Prebuild is for native config; JS deps don't need it.

Unnecessary prebuilds cost 60–120s and risk wiping any custom native edits (which the agent shouldn't have made, but).

SDK version pin

The template ships with Expo SDK 51 and react-native-tvos@0.74-stable (or whatever the README states — verify on clone). Compatibility table:

Expo SDKreact-native-tvos versionNotes
510.74-stableTemplate default
520.76-stableNewer; verify all deps
540.81-stableLatest at time of writing; newest TV features

If the user requests a newer SDK, bump deliberately:

  1. Update expo and react-native (the alias to react-native-tvos) in both apps.
  2. Update transitive deps that have SDK constraints (expo-router, expo-font, etc.).
  3. yarn install.
  4. expo prebuild --clean.
  5. Build for each platform; expect to fix 1–3 small issues per major SDK bump.

The agent should not silently bump. SDK changes are visible diffs.

EAS profile (when EAS Build is in use)

// eas.json
{
  "build": {
    "preview-tv-android": {
      "extends": "preview",
      "env": { "EXPO_TV": "1" },
      "android": { "buildType": "apk" }
    },
    "preview-tv-ios": {
      "extends": "preview",
      "env": { "EXPO_TV": "1" },
      "ios": { "simulator": false }
    }
  }
}

env.EXPO_TV is the equivalent of the shell variable. Without it on EAS, you get a mobile build out of the cloud — same symptom as locally.

Common config errors and fixes

SymptomCauseFix
Mobile-looking app on a TV targetEXPO_TV not set during prebuildRe-run with the env var, --clean
Prebuild fails: "android resource not found"Banner path wrong in app.jsonFix path; rerun prebuild
Prebuild succeeds but app crashes on launchSDK / react-native-tvos version mismatchAlign versions per the table above
expo run:ios builds a phone appXcode scheme is the phone targetOpen ios/, switch scheme to the -tvOS variant, or use expo run:ios --device <TV-simulator>
"Plugin not found: @react-native-tvos/config-tv"Plugin not installed in the app's workspaceyarn workspace expo-multi-tv add @react-native-tvos/config-tv
Banner appears stretchedWrong dimensions, not exactly 400×240Regenerate at correct size

When to update plugins vs runtime

Plugin updates → require prebuild. Runtime JS updates → don't.

If a plugin update is included in a normal yarn and the agent forgets to prebuild afterward, the build will succeed but the change won't take effect on native. Always prebuild after a plugin change.

Anti-patterns

  • Setting EXPO_TV inside the JS code. It's a build-time variable. Setting it at runtime does nothing.
  • Editing ios/ or android/ directly to "fix" something. Prebuild will erase it. If a fix is needed, write or extend a config plugin.
  • Skipping --clean during prebuild because "it's faster". It is faster. It's also the source of half of the "works on my machine" bugs.
  • Running expo run:ios when an iPhone simulator is open. The build may target the phone. Specify the TV device or close the phone simulator first.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.