开发者控制台
感谢您的访问。此页面目前仅提供英语版本。我们正在开发中文版本。谢谢您的理解。

Get Started with React Native (Fire TV)

Amazon Fire TV supports React Native, which is an open-source mobile application development framework that leverages the React web development framework. React Native originally included some support for TVs in 2020. Since then, React Native maintainers began splitting modules into separate repositories for better maintenance. Consequently, the maintainers moved TV support to a dedicated project called React Native tvOS.

The react-native-tvos project is an open-source fork of the main React Native repository specifically tailored to making existing React Native apps work on TV. The project provides TV support such as focus management and access to touchable controls to your React Native app.

For new React Native apps, you can use Expo, which is a popular suite of open-source developer tools and services for building and deploying React Native apps. For more details on how to use Expo, see Build Expo apps for TV.

To learn more about the features, designs, and strategies available to you when building React Native apps, see Start building apps for TV with React Native.

Prerequisites

Getting started with React Native requires the following:

  • Node.js: Use Node.js as the JavaScript runtime environment.
  • npm or Yarn: Install these package managers for JavaScript.
  • Android Studio: Use Android Studio as the IDE to compile and run your Fire OS apps locally.

Configure Android Studio

You must configure Android Studio and its command line tools.

To configure Android Studio

  1. Set your ANDROID_HOME environment variable. For OS specific instructions, see How to set environment variables.

  2. Install the Android TV emulator from the Virtual Device Manager.

Build your Fire TV app

To build apps for Fire TVs with React Native, you must create a new project with the expo package installed.

To create a new project

  • At the command prompt, create a new React Native project with the expo package installed.

    npx create-expo-app FireTVDemo -e with-tv
    

Run your project on the Android TV emulator

You can launch and run your project on the Android TV emulator.

To run your project on the TV emulator

  1. At the command prompt, list the available Android Virtual Devices (AVD).

    emulator -list-avds
    
  2. Launch the Android TV emulator.

    emulator -avd <name-of-your-tv-emulator>
    
  3. Navigate to the project directory.

    cd FireTVDemo
    
  4. Run the app using npx.

    npx expo start -a
    

Your app is running on the avd emulator using a local development server and Expo Go. You don't have to create the Android build.

Run your project on a Fire TV device

In order to run your project on a Fire TV device, you must first target the build for TVs.

To run your project on a Fire TV device

  1. In your app.json, set the isTV property to true.

    {
      "expo": {
        "plugins": [
          [
            "@react-native-tvos/config-tv",
            {
              "isTV": true,
            }
          ]
        ],
        "name": "FireTVDemo",
        "slug": "FireTVDemo"
      }
    }
    
  2. Connect your Fire TV. For instructions, see Connect to Fire TV Through ADB (Fire TV).

  3. Check that your device is connected using adb.

    adb devices -l
    

    A list of attached devices is returned.

  4. Navigate to the project directory.

    cd FireTVDemo
    
  5. Run a development build on your target device (for example, -d AFTSS).

    cd FireTVDemo
    npx expo run:android -d <deviceName>
    

You have the development build installed on your device within the android directory. You can verify that your Android builds are optimized for TV by checking that your app is using the Android leanback features in the Android manifest file.


Last updated: Jul 22, 2025