expo-dev-client
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseUse EAS Build to create development clients for testing native code changes on physical devices. Use this for creating custom Expo Go clients for testing branches of your app.
使用EAS Build创建开发客户端,以便在物理设备上测试原生代码变更。可用于创建自定义Expo Go客户端,以测试应用的分支版本。
Important: When Development Clients Are Needed
重要提示:何时需要开发客户端
Only create development clients when your app requires custom native code. Most apps work fine in Expo Go.
You need a dev client ONLY when using:
- Local Expo modules (custom native code)
- Apple targets (widgets, app clips, extensions)
- Third-party native modules not in Expo Go
Try Expo Go first with . If everything works, you don't need a dev client.
npx expo start仅当你的应用需要自定义原生代码时,才创建开发客户端。 大多数应用在Expo Go中即可正常运行。
仅在以下场景中你才需要开发客户端:
- 本地Expo模块(自定义原生代码)
- Apple端目标(小组件、App Clip、扩展功能)
- Expo Go未包含的第三方原生模块
请先尝试使用Expo Go,执行。如果一切正常,则无需开发客户端。
npx expo startEAS Configuration
EAS配置
Ensure has a development profile:
eas.jsonjson
{
"cli": {
"version": ">= 16.0.1",
"appVersionSource": "remote"
},
"build": {
"production": {
"autoIncrement": true
},
"development": {
"autoIncrement": true,
"developmentClient": true
}
},
"submit": {
"production": {},
"development": {}
}
}Key settings:
- - Bundles expo-dev-client for development builds
developmentClient: true - - Automatically increments build numbers
autoIncrement: true - - Uses EAS as the source of truth for version numbers
appVersionSource: "remote"
确保文件中包含开发配置项:
eas.jsonjson
{
"cli": {
"version": ">= 16.0.1",
"appVersionSource": "remote"
},
"build": {
"production": {
"autoIncrement": true
},
"development": {
"autoIncrement": true,
"developmentClient": true
}
},
"submit": {
"production": {},
"development": {}
}
}关键配置项:
- - 为开发构建打包expo-dev-client
developmentClient: true - - 自动递增构建版本号
autoIncrement: true - - 使用EAS作为版本号的可信来源
appVersionSource: "remote"
Building for TestFlight
为TestFlight构建
Build iOS dev client and submit to TestFlight in one command:
bash
eas build -p ios --profile development --submitThis will:
- Build the development client in the cloud
- Automatically submit to App Store Connect
- Send you an email when the build is ready in TestFlight
After receiving the TestFlight email:
- Download the build from TestFlight on your device
- Launch the app to see the expo-dev-client UI
- Connect to your local Metro bundler or scan a QR code
通过一条命令构建iOS开发客户端并提交至TestFlight:
bash
eas build -p ios --profile development --submit该命令将:
- 在云端构建开发客户端
- 自动提交至App Store Connect
- 当构建在TestFlight中准备就绪时向你发送邮件
收到TestFlight邮件后:
- 在你的设备上从TestFlight下载构建包
- 启动应用,查看expo-dev-client界面
- 连接到本地Metro打包器或扫描二维码
Building Locally
本地构建
Build a development client on your machine:
bash
undefined在你的设备上构建开发客户端:
bash
undefinediOS (requires Xcode)
iOS(需要Xcode)
eas build -p ios --profile development --local
eas build -p ios --profile development --local
Android
Android
eas build -p android --profile development --local
Local builds output:
- iOS: `.ipa` file
- Android: `.apk` or `.aab` fileeas build -p android --profile development --local
本地构建输出:
- iOS:`.ipa`文件
- Android:`.apk`或`.aab`文件Installing Local Builds
安装本地构建包
Install iOS build on simulator:
bash
undefined在模拟器上安装iOS构建包:
bash
undefinedFind the .app in the .tar.gz output
在.tar.gz输出文件中找到.app文件
tar -xzf build-*.tar.gz
xcrun simctl install booted ./path/to/App.app
Install iOS build on device (requires signing):
```bashtar -xzf build-*.tar.gz
xcrun simctl install booted ./path/to/App.app
在设备上安装iOS构建包(需要签名):
```bashUse Xcode Devices window or ideviceinstaller
使用Xcode设备窗口或ideviceinstaller
ideviceinstaller -i build.ipa
Install Android build:
```bash
adb install build.apkideviceinstaller -i build.ipa
安装Android构建包:
```bash
adb install build.apkBuilding for Specific Platform
为特定平台构建
bash
undefinedbash
undefinediOS only
仅iOS
eas build -p ios --profile development
eas build -p ios --profile development
Android only
仅Android
eas build -p android --profile development
eas build -p android --profile development
Both platforms
两个平台
eas build --profile development
undefinedeas build --profile development
undefinedChecking Build Status
检查构建状态
bash
undefinedbash
undefinedList recent builds
列出最近的构建记录
eas build:list
eas build:list
View build details
查看构建详情
eas build:view
undefinedeas build:view
undefinedUsing the Dev Client
使用开发客户端
Once installed, the dev client provides:
- Development server connection - Enter your Metro bundler URL or scan QR
- Build information - View native build details
- Launcher UI - Switch between development servers
Connect to local development:
bash
undefined安装完成后,开发客户端提供以下功能:
- 开发服务器连接 - 输入Metro打包器URL或扫描二维码
- 构建信息 - 查看原生构建详情
- 启动器界面 - 在不同开发服务器间切换
连接到本地开发环境:
bash
undefinedStart Metro bundler
启动Metro打包器
npx expo start --dev-client
npx expo start --dev-client
Scan QR code with dev client or enter URL manually
使用开发客户端扫描二维码或手动输入URL
undefinedundefinedTroubleshooting
故障排除
Build fails with signing errors:
bash
eas credentialsClear build cache:
bash
eas build -p ios --profile development --clear-cacheCheck EAS CLI version:
bash
eas --version
eas update构建因签名错误失败:
bash
eas credentials清理构建缓存:
bash
eas build -p ios --profile development --clear-cache检查EAS CLI版本:
bash
eas --version
eas update