Vega (Fire TV)
React Native Harness runs tests on the Vega Virtual Device and on Fire TV devices running Vega OS, using an app built with React Native for Vega.
Overview
The Vega runner drives the vega CLI from the Vega SDK. It starts the Vega Virtual Device when it is not running, installs the app package (.vpkg) from HARNESS_APP_PATH, forwards Metro's port to the device, launches the app by its component id, and follows the app's process and device logs for the duration of the run. Build the app with react-native build-vega before invoking Harness.
Installation
Configuration
Import the Vega platform helpers in your rn-harness.config.mjs:
Options
Finding device names
vega device list prints every device the SDK can reach. The Vega Virtual Device shows up as VirtualDevice, which is the default for vegaVirtualDevice(). Fire TV devices are listed by serial number:
Building and deploying the app
Harness needs a Debug package, because debug builds load the JavaScript bundle from Metro:
The package lands in build/<arch>-debug/<appName>_<arch>.vpkg, one per architecture: aarch64 for the virtual device on Apple Silicon, x86_64 for the virtual device on Intel, and armv7 for Fire TV devices.
Point HARNESS_APP_PATH at the package that matches the target and run the tests:
Harness installs the package when the app is missing, and reinstalls it whenever HARNESS_APP_PATH is set. With HARNESS_APP_PATH unset, the app must already be installed on the device.
Install Debug packages with the Debug build type. vega device install-app defaults to Release, and a Debug app installed that way never gets the debug sandbox configuration it needs to reach Metro, so Vega OS kills it as unresponsive about fifteen seconds after launch. Harness passes --buildType Debug itself; when you install manually, add -b Debug.
Fire TV devices
-
On the Fire TV, open Settings > My Fire TV > About, select the device name seven times to unlock developer options, then enable Developer Mode. The device shows a six digit code.
-
On your machine, sign in and enable the device:
-
After the device reboots, confirm it is listed by
vega device listand use its serial number invegaPhysicalDevice(...). -
Build the
armv7package and run thefire-tvrunner withHARNESS_APP_PATHpointing at it.
The device must be on the same network as your machine.
Metro configuration
Harness applies the same out-of-tree platform wiring that react-native start gets from @amazon-devices/kepler-cli-platform (the react-native → @amazon-devices/react-native-kepler resolver redirect and the kepler platform), so a plain metro.config.js works. Vega system bundles are honoured too: when the app uses them (the default), Harness applies the plugin's split-bundle config so React Native comes from the OS copy and the app bundle stays small; with kepler.useSystemJsBundles: false the whole bundle is served by Harness.
Platform-specific test files use the vega suffix, for example settings.vega.harness.ts, while Platform.OS inside tests is 'kepler'.
Vega apps load the bundle from http://localhost:8081 on the device. Harness reverse-forwards that port to its Metro server with vega device start-port-forwarding. When Harness has to run Metro on a different port, it maps the ports with the SDK's vda tool, and fails with a clear error if vda is not available. vda identifies devices by adb-style serials, so this fallback works with a single attached device, or with a physical device whose serial vda reports; with a virtual device and a Fire TV attached at the same time keep Metro on 8081.
Limitations
@react-native-harness/ui(screen,userEvent, screenshots) has no Vega native module yet, so test files importing it fail to load on Vega.- Crash detection relies on the app process disappearing and on the device log stream (Vega OS reports the kill reason there, for example
AppNotResponding). Minidumps are not collected.
Requirements
- Vega SDK 0.24 or newer on macOS or Ubuntu, with the
vegaCLI onPATH(source ~/vega/env). Harness also looks in$KEPLER_SDK_PATH/binand~/vega/bin, or at the binary named byVEGA_CLI_PATH. - An app built with
@amazon-devices/react-native-kepler4.x (React Native 0.83). - A Debug
.vpkgfor the target architecture, passed throughHARNESS_APP_PATH.
CI
The Vega SDK is not available on GitHub-hosted runners. Run Vega jobs on a self-hosted runner with the SDK installed — see Running in CI/CD.
