expo
Manage Expo React Native projects
TLDR
Build an Android APK or AAB
Build an iOS IPA
Run the app in Expo Go
Install a dependency
Prebuild native Android/iOS projects
Run the app on Android
Run the app on iOS
SYNOPSIS
The `expo` command generally follows a subcommand pattern:
`expo command [options]`
`expo command [args]`
Common top-level commands include `init`, `start`, `build`, `publish`, `login`, and `whoami`.
Specific command syntax varies:
`expo init project-name [--template template-name]`
`expo start [--tunnel | --no-tunnel | --web | --ios | --android | -c | -s | -a | -i | -w | --host lan|tunnel|localhost]`
`expo build:platform [--type archive|simulator] [--release-channel channel]`
Note: For full command details and options, consult the official Expo documentation or run `expo help command`.
PARAMETERS
--version
Display the Expo CLI version currently installed.
--help, -h
Show help for the Expo CLI or a specific command (e.g., `expo start --help`).
--non-interactive
Run the command in non-interactive mode, useful for scripting.
--json
Output results in JSON format, typically for machine readability.
--port number
Specify the port for the development server (e.g., with `expo start`).
--tunnel
Use a tunnel to make the development server accessible from anywhere (e.g., with `expo start`).
--web
Start the development server specifically for web platforms (e.g., with `expo start`).
--ios
Open the app in the iOS simulator or prompt to open on device (e.g., with `expo start`).
--android
Open the app in the Android emulator or prompt to open on device (e.g., with `expo start`).
--template template-name
Specify a template for a new project during initialization (e.g., with `expo init`).
--clean, -c
Clear the Metro bundler cache (e.g., with `expo start`).
--host type
Specify host type (`lan`, `tunnel`, `localhost`) for `expo start` to control network accessibility.
DESCRIPTION
The Expo CLI is a powerful command-line interface designed to streamline the development, building, and deployment of universal React applications, including React Native projects. It abstracts away complex native build processes, allowing developers to write JavaScript once and deploy it to iOS, Android, and web platforms with minimal configuration. Expo CLI facilitates crucial workflows like project initialization, local development server management, publishing updates, and building standalone native apps. It provides a comprehensive ecosystem of tools and services, including a large library of pre-built components and APIs, making cross-platform development more accessible and efficient for JavaScript developers.
CAVEATS
- Prerequisites: Requires Node.js and npm/yarn to be installed on the system.
- Not a Core Utility: `expo` is a third-party CLI tool for JavaScript development, not a standard Linux system command or utility found in `coreutils`. It must be installed globally (e.g., `npm install -g expo-cli` or `npx expo`).
- Internet Dependency: Many operations, especially `build` and `publish`, rely on internet connectivity and Expo's cloud services.
- Ejected Projects: While flexible, projects that have been "ejected" (using `expo prebuild` or `npx react-native eject`) might lose some of the benefits of the Expo managed workflow and require more manual configuration.
- Limited Native Module Access: In the managed workflow, direct access to custom native modules is restricted. Using custom native code requires "ejecting" or creating development builds with `expo prebuild`.
MANAGED WORKFLOW VS. BARE WORKFLOW
The managed workflow, powered by Expo CLI, abstracts away native code details, offering rapid development and cloud builds. The bare workflow (akin to plain React Native) provides full control over native code and allows the use of any native module, but requires more manual setup and native build tool knowledge.
EXPO GO APP
The Expo Go mobile app (available on iOS and Android app stores) is essential for local development. Developers scan a QR code from `expo start` to instantly preview their app on a physical device without building an APK or IPA.
HISTORY
The Expo CLI emerged as a crucial tool for simplifying React Native development, which traditionally involved complex Xcode/Android Studio setups. Expo began as a wrapper around React Native, providing a managed workflow that handled native build tools and configurations, allowing developers to focus solely on JavaScript code. Over time, it evolved to support more advanced use cases, including custom native code through development builds (`expo prebuild`), and expanded its reach to target web platforms, truly embodying the "universal React" vision. Its development is closely tied to the broader React Native ecosystem, continuously adapting to new features and best practices to provide a streamlined developer experience.
SEE ALSO
npm(1), yarn(1), node(1), react-native(1), webpack(1)


