Androidstudio模拟器运行不了
弹窗报错:Emulator failed to connect within 5 minutes
日志显示:FATAL | Running multiple emulators with the same AVD is an experimental feature. | Please use -read-only flag to enable this feature.
Androidstudio模拟器运行不了
弹窗报错:Emulator failed to connect within 5 minutes
日志显示:FATAL | Running multiple emulators with the same AVD is an experimental feature. | Please use -read-only flag to enable this feature.
下午好🌅🌅🌅
本答案参考通义千问
你遇到的问题是 Android Studio 模拟器无法启动,并弹出错误提示:
Emulator failed to connect within 5 minutes
同时日志显示:
FATAL | Running multiple emulators with the same AVD is an experimental feature. | Please use -read-only flag to enable this feature.
这个错误通常出现在以下几种情况中:
以下是详细的解决步骤,按优先级排序:
⚠️ 注意: 不建议同时运行多个相同 AVD,因为这是实验性功能,容易引发冲突。
-read-only 标志运行模拟器(仅在需要多实例时)如果你确实需要运行多个相同 AVD 的实例,可以按照提示使用 -read-only 标志。
打开终端(Terminal),输入以下命令:
emulator -avd <你的AVD名称> -read-only
例如:
emulator -avd Pixel_4_API_30 -read-only
⚠️ 注意: 使用
-read-only后,模拟器将无法保存数据,每次重启都会重置。
~/.android/avd/<your_avd_name>.avdemulator, qemu-system-x86_64 等进程.avd 文件夹config.ini 文件hw.gpu.enabled=no
⚠️ 注意: 这会禁用 GPU 加速,可能导致性能下降,但有助于解决某些兼容性问题。
如果你是通过脚本启动模拟器,可以修改为:
#!/bin/bash
emulator -avd Pixel_4_API_30 -read-only
| 步骤 | 描述 |
|------|------|
| 1 | 确保没有重复运行相同的 AVD |
| 2 | 使用 -read-only 标志运行多个 AVD 实例 |
| 3 | 清理和重建 AVD 配置 |
| 4 | 更新 Android Studio 和 SDK |
| 5 | 检查并结束冲突的模拟器进程 |
| 6 | 修改配置文件以避免冲突 |
如果问题仍然存在,请提供完整的日志信息(包括 Android Studio 控制台输出和 emulator 日志)以便进一步排查。
如需帮助,请贴出你的完整错误日志。