expo-cli
Tools for creating, running, and deploying universal Expo and React Native apps
Top Related Projects
The React Native Community CLI - command line tools to help you build RN apps
The Ionic command-line interface
Command-line interface for building NativeScript apps
Quick Overview
Expo CLI is a command-line tool for developing, building, and publishing Expo and React Native apps. It provides a set of utilities to streamline the development process, manage dependencies, and deploy applications across multiple platforms.
Pros
- Simplified development workflow for React Native apps
- Cross-platform support for iOS, Android, and web
- Extensive library of pre-built components and APIs
- Easy integration with Expo's cloud services for building and publishing
Cons
- Limited access to native modules compared to pure React Native
- Larger app size due to included Expo runtime
- Potential performance overhead in some scenarios
- Dependency on Expo's ecosystem and update cycle
Code Examples
- Creating a new Expo project:
npx create-expo-app my-new-app
cd my-new-app
npx expo start
- Adding a new dependency:
npx expo install react-native-maps
- Building for production:
npx expo build:android
npx expo build:ios
Getting Started
To get started with Expo CLI, follow these steps:
- Install Node.js (version 12 or later)
- Install Expo CLI globally:
npm install -g expo-cli
- Create a new project:
expo init my-new-project
cd my-new-project
- Start the development server:
expo start
- Open the Expo Go app on your mobile device and scan the QR code displayed in the terminal to run your app.
Competitor Comparisons
The React Native Community CLI - command line tools to help you build RN apps
Pros of react-native-cli
- Offers more flexibility and control over native modules and dependencies
- Allows direct access to native code for advanced customization
- Supports a wider range of third-party libraries and native modules
Cons of react-native-cli
- Steeper learning curve, especially for developers new to mobile development
- Requires more setup and configuration for each project
- May need additional tools and knowledge for managing native dependencies
Code Comparison
expo-cli:
import { Camera } from 'expo-camera';
const CameraComponent = () => (
<Camera style={{ flex: 1 }} type={Camera.Constants.Type.back} />
);
react-native-cli:
import { RNCamera } from 'react-native-camera';
const CameraComponent = () => (
<RNCamera style={{ flex: 1 }} type={RNCamera.Constants.Type.back} />
);
Both CLI tools serve different purposes and cater to different developer needs. expo-cli provides a smoother development experience with pre-configured tools and services, making it ideal for rapid prototyping and simpler apps. react-native-cli offers more control and customization options, suitable for complex projects requiring native module integration and advanced features. The choice between the two depends on the project requirements, developer expertise, and desired level of control over the development process.
The Ionic command-line interface
Pros of Ionic CLI
- Supports multiple frameworks (Angular, React, Vue) for cross-platform development
- Offers a more comprehensive set of tools for building, testing, and deploying apps
- Provides better integration with native device features and plugins
Cons of Ionic CLI
- Steeper learning curve, especially for developers new to hybrid app development
- May have slower performance compared to native apps or Expo-built applications
- Requires more setup and configuration for certain features
Code Comparison
Expo CLI:
expo init my-app
cd my-app
expo start
Ionic CLI:
ionic start my-app blank
cd my-app
ionic serve
Both CLIs offer similar basic commands for project initialization and development. However, Ionic CLI provides more advanced commands for generating components, pages, and services specific to the chosen framework.
Expo CLI focuses on React Native development and offers a simpler setup process, while Ionic CLI supports multiple frameworks and provides more flexibility in terms of native functionality and customization.
Expo CLI is generally easier for beginners and rapid prototyping, whereas Ionic CLI is better suited for more complex, feature-rich applications that require deeper integration with native device capabilities.
Command-line interface for building NativeScript apps
Pros of nativescript-cli
- Provides direct access to native APIs, allowing for more advanced and platform-specific features
- Supports a wider range of programming languages, including TypeScript, JavaScript, and Angular
- Offers more flexibility in terms of project structure and third-party library integration
Cons of nativescript-cli
- Steeper learning curve, especially for developers new to mobile development
- Requires more setup and configuration compared to Expo's streamlined approach
- Smaller community and ecosystem compared to Expo, potentially leading to fewer resources and plugins
Code Comparison
NativeScript CLI (app.ts):
import { Application } from '@nativescript/core';
Application.run({ moduleName: 'app-root' });
Expo CLI (App.js):
import React from 'react';
import { View, Text } from 'react-native';
import { registerRootComponent } from 'expo';
function App() {
return (
<View>
<Text>Hello, Expo!</Text>
</View>
);
}
registerRootComponent(App);
The NativeScript CLI example shows a more bare-bones approach to launching an application, while the Expo CLI example demonstrates its React-based structure and simplified setup process.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
The modern local Expo CLI is included with the expo
package and does not need to be installed separately. Run it with npx expo
. Its source code lives in the expo/expo
repo.
Assorted Expo Dev Tools
This repo consists of packages used in the legacy global Expo CLI and related tooling.
ð Documentation
Learn about building and deploying universal apps in our official docs!
ðº Project Layout
Package | Version |
---|---|
expo-cli | |
expo-codemod | |
@expo/image-utils | |
@expo/json-file | |
@expo/next-adapter | |
@expo/osascript | |
@expo/pkcs12 | |
@expo/plist | |
pod-install | |
expo-pwa | |
@expo/schemer | |
uri-scheme | |
@expo/webpack-config |
ð Contributing
If you like the Expo CLI and want to help make it better then check out our contributing guide! Also check out the Expo repo to work on the Expo docs, modules, and components in the Expo SDK.
â FAQ
If you have questions about Expo and want answers, then check out our Frequently Asked Questions!
If you still have questions you can ask them on our forums or on Twitter @Expo.
ð The Team
Curious about who makes Expo? Here are our team members!
License
The Expo source code is made available under the MIT license. Some of the dependencies are licensed differently, with the BSD license, for example.
Top Related Projects
The React Native Community CLI - command line tools to help you build RN apps
The Ionic command-line interface
Command-line interface for building NativeScript apps
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot