创建开发版本
了解如何为项目创建开发版本。
使用 npx create-expo-app
创建新的 Expo 应用时,你将从一个项目开始,在该项目中更新本地计算机上的 JavaScript 代码,并在 Expo Go 应用中查看更改。开发版本本质上是你自己的 Expo Go 版本,你可以自由使用任何原生库并更改任何原生配置。在本指南中,你将学习如何将运行在 Expo Go 上的项目转换为开发版本,这将使你的应用的原生端完全可定制。
¥When you create a new Expo app with npx create-expo-app
, you start off with a project where you update the JavaScript code on your local machine and view the changes in the Expo Go app. A development build is essentially your own version of Expo Go where you are free to use any native libraries and change any native config. In this guide, you will learn how to convert your project that runs on Expo Go into a development build, which will make the native side of your app fully customizable.

先决条件
¥Prerequisites
这些说明假设你已经有一个在 Expo Go 上运行的 Expo 项目。
¥The instructions assume you already have an existing Expo project that runs on Expo Go.
构建原生应用的要求取决于你使用的平台、构建的目标平台以及你是在 EAS 上构建还是在本地机器上构建。
¥The requirements for building the native app depend on which platform you are using, which platform you are building for, and whether you want to build on EAS or on your local machine.
Build on EAS
This is the easiest way to build your native app, as it requires no native build tools on your side. The builds happen on the EAS servers, which makes it possible to trigger iOS builds from non-macOS platforms.
Android | iOS Simulator | iPhone device | |
---|---|---|---|
macOS | (*) | ||
Windows | (*) | ||
Linux | (*) |
(*) All builds that run on an iPhone device require a paid Apple Developer account for build signing.
Build locally using the EAS CLI
Any EAS CLI command can be built on your local machine with the --local
flag. This requires your local development environment to be set up with native build tools. Read more about local app development.
Android | iOS Simulator | iPhone device | |
---|---|---|---|
macOS | (*) | ||
Windows | (**) | ||
Linux |
(*) All builds that run on an iPhone device require a paid Apple Developer account for build signing.
(**) No first-class support, but possible with WSL.
Build locally without EAS
To build locally without EAS requires your local development environment to be set up with native build tools. This is the only way to test your iOS build on an iPhone device without a paid Apple Developer Account (only possible on macOS). Read more about local app compilation.
Android | iOS Simulator | iPhone device | |
---|---|---|---|
macOS | |||
Windows | |||
Linux |
Get started
For detailed, step-by-step instructions, see our EAS Tutorial. Available also as a tutorial series on YouTube.
1
Install expo-dev-client
-
npx expo install expo-dev-client
Are you using this library in a existing (bare) React Native apps?
Apps that don't use Continuous Native Generation or are created with npx react-native
, require further configuration after installing this library. See steps 1 and 2 from Install expo-dev-client
in an existing React Native app.
2
Build the native app (Android)
3 requirements
3 requirements
1.
Expo account
Sign up for an Expo account, if you haven't already.
2.
EAS CLI
The EAS CLI installed and logged in.
-
npm install -g eas-cli && eas login
3.
An Android Emulator (optional)
An Android Emulator is optional if you want to test your app on an emulator.
-
eas build --platform android --profile development
Read more about Android builds on EAS.
2 requirements
2 requirements
1.
Development environment set up
A macOS, Windows, or Linux machine with your local development environment set up.
2.
An Android Emulator (optional)
An Android Emulator is optional if you want to test your app on an emulator.
-
npx expo run:android
The same apk
can be installed on Android devices as well as emulators.
Read more about local app development.
2
Build the native app (iOS Simulator)
3 requirements
3 requirements
1.
Expo account
Sign up for an Expo account, if you haven't already.
2.
EAS CLI
The EAS CLI installed and logged in.
-
npm install -g eas-cli && eas login
3.
macOS with iOS Simulator installed
iOS Simulators are available only on macOS. Make sure you have the iOS Simulator installed.
Edit development
profile in eas.json and set the simulator
option to true
(you have to create a separate profile for simulator builds if you also want to create iOS device builds for this project).
{
"build": {
"development": {
"ios": {
"simulator": true
}
}
}
}
-
eas build --platform ios --profile development
iOS Simulator builds can only be installed on simulators and not on real devices.
Read more about iOS Simulator builds on EAS.
2 requirements
2 requirements
1.
macOS
iOS Simulators are available only on macOS.
2.
Development environment set up
Set up your local development environment.
-
npx expo run:ios
Read more about local app development.
2
Build the native app (iOS device)
3 requirements
3 requirements
1.
Expo account
Sign up for an Expo account, if you haven't already.
2.
EAS CLI
The EAS CLI installed and logged in.
-
npm install -g eas-cli && eas login
3.
Apple Developer account
A paid Apple Developer account for creating signing credentials so the app could be installed on an iOS device.
-
eas build --platform ios --profile development
iOS device builds can only be installed on iPhone devices and not on iOS Simulators.
Read more about iOS device builds on EAS.
2 requirements
2 requirements
1.
macOS
macOS is required to compile the native app for iOS devices.
2.
Development environment set up
Set up your local development environment.
-
npx expo run:ios --device
Read more about local app development.
3
Install the app
You'll need to install the native app on your device, emulator, or simulator.
When building on EAS
If you create your development build on EAS, the CLI will prompt you to install the app after the build is finished. You can also install previous builds from the expo.dev dashboard or using Expo Orbit.
When building locally using EAS CLI
When building locally the output of the build will be an archive. You may drag and drop this on your Android Emulator/iOS Simulator to install it, or use Expo Orbit to install a build from your local machine.
When building locally without EAS CLI
Local builds will get installed automatically once the build finishes.
4
Start the bundler
The development client built in step 2 is the native side of your app (basically your own version of Expo Go). To continue developing, you'll also want to start the JavaScript bundler.
Depending on how you built the app, this may already be running, but if you close the process for any reason, there is no need to rebuild your development client. Simply restart the JavaScript bundler with:
-
npx expo start
This is the same command you would have used with Expo Go. It detects whether your project has expo-dev-client
installed, in which case it will default to targeting your development build instead of Expo Go.
视频演练
¥Video walkthroughs
YouTube 课程:学习如何使用 Expo 应用服务加速你的开发。
观看由开发者成功工程师 Keith Kurak 主持的视频教程,了解如何使用 EAS Build 进行开发构建。