Mac全新安装Flipper遇连接错误及设备检测问题求助
Flipper在Mac M1上的连接与设备识别问题
问题现象
启动Flipper时出现端口占用错误:
Connection error Couldn't start connection server. Looks like you have multiple copies of Flipper running or another process is using the same port(s). As a result devices will not be able to connect to Flipper. Please try to kill the offending process by running kill $(lsof -ti:PORTNUMBER) and restart flipper. Error: listen EADDRINUSE: address already in use :::8089
执行命令杀死8089端口进程后,进程会立即重启。
同时,即使在Xcode模拟器中运行React Native应用,Flipper仍提示:
NO DEVICES FOUND No devices found Start a fresh emulator or check the troubleshooting guide.
点击Flipper中的「Start Emulator / Simulator」图标后,弹出模态框无响应,加载动画无限转动。
环境信息
- OS: macOS Monterey v12.6.3
- 芯片: Apple M1
已尝试的无效操作
按照官方文档配置自定义端口,执行以下命令后无效果:
xcrun simctl spawn booted defaults write "Apple Global Domain" "com.facebook.flipper.ports" -string "1111,2222"
Flipper doctor检测显示一切正常,但问题依旧。
解决方案建议
- 彻底排查端口占用进程
- 执行
lsof -i :8089查看进程详细信息,确认进程名称和PID - 若为第三方进程,用
kill -9 [PID]强制终止(替换[PID]为实际进程ID);若为系统进程,尝试重启Mac后再启动Flipper
- 执行
- 修正自定义端口配置
- 关闭所有Flipper实例和模拟器
- 在Mac系统级别执行配置命令:
defaults write com.facebook.flipper.plist "ports" -array "1111" "2222" - 重启Flipper和模拟器,检查端口是否正常使用
- 重置Flipper配置
- 关闭Flipper,删除配置目录:
rm -rf ~/Library/Application\ Support/Flipper - 重新启动Flipper,生成全新配置文件
- 关闭Flipper,删除配置目录:
- 修复模拟器连接问题
- 在Xcode中打开模拟器,执行
xcrun simctl list确认模拟器状态正常 - 重置模拟器:点击模拟器顶部菜单「Device」>「Erase All Content and Settings...」,完成后重启模拟器和Flipper
- 在React Native项目中手动指定端口:在
ios/Podfile中添加Flipper端口配置,或在AppDelegate.m的Flipper初始化代码中指定自定义端口
- 在Xcode中打开模拟器,执行
内容的提问来源于stack exchange,提问作者Ben
相关产品推荐
相关产品推荐

