运行expo start --dev-client时提示No apps connected的问题求助
Expo Dev Client 真机开发连接问题排查方案
问题背景
使用expo-dev-client在iOS/Android真机上进行动态开发,通过eas build --profile staging构建了开启"developmentClient": true的安装包,相关配置如下:
eas.json 配置
{"build": {"staging": {"android": {"gradleCommand": ":app:assembleStagingRelease"},"ios": {"image": "latest","buildConfiguration": "Staging","scheme": "Stage"},"developmentClient": true,"channel": "staging","distribution": "internal"}}}
package.json 依赖
{"dependencies": {"expo": "^46.0.0","expo-dev-client": "~1.3.1","expo-dev-launcher": "1.3.1","react-native": "0.69.6","react-dom": "18.0.0","react": "18.0.0"}}
出现的问题:
- 设备安装应用后,笔记本运行
expo start --dev-client,扫码直接打开应用但不显示expo dev launcher界面 - 按
r重载时提示:warn No apps connected. Sending "reload" to all React Native apps failed. Make sure your app is running in the simulator or on a phone connected via USB. - 已确认设备与笔记本处于同一WiFi环境
排查与解决步骤
- 校验构建配置一致性
确保eas.json中staging配置的iOS Scheme/Android Build Variant与项目实际配置匹配:iOS的scheme: "Stage"需在Xcode中存在并正确关联开发客户端配置;Android的:app:assembleStagingRelease需对应开启dev client的构建变体。 - 手动唤起Dev Launcher
在项目入口文件(如App.js)中添加触发逻辑,强制唤起Dev Launcher验证功能是否正常,示例代码:import * as DevLauncher from 'expo-dev-launcher'; import { useEffect } from 'react'; useEffect(() => { if (__DEV__) { setTimeout(() => { DevLauncher.openLauncher(); }, 3000); } }, []); - 匹配CLI与依赖版本
确认本地Expo CLI版本适配Expo 46,建议使用expo-cli@6.0.0左右版本,运行expo --version查看当前版本,若不匹配则执行npm install -g expo-cli@6.0.0更新。 - 切换连接方式
- 使用USB线连接设备,运行
expo start --dev-client --localhost强制本地连接,规避WiFi的AP隔离或端口拦截问题 - 若USB连接有效,检查笔记本防火墙是否放行Expo默认端口(19000-19006),再切换回WiFi连接
- 使用USB线连接设备,运行
- 清理缓存重新构建
执行eas build --profile staging --clear-cache清理构建缓存后重新构建安装包,避免旧缓存导致配置不生效 - iOS专属检查
- 确认设备已信任应用对应的开发者证书(路径:设置-通用-VPN与设备管理)
- 在Xcode中检查Stage scheme的Build Configuration是否设为Staging,且Staging配置中开启了
ENABLE_DEV_CLIENT编译选项
- Android专属检查
- 在
android/app/build.gradle中确认Staging变体配置了buildConfigField "boolean", "ENABLE_DEV_CLIENT", "true" - 若使用USB连接,确保设备已开启USB调试并授权当前电脑的调试权限
- 在
内容的提问来源于stack exchange,提问作者dev1ce
相关产品推荐
相关产品推荐

