执行 scrcpy -s localhost:5555 报错
cannot start document portal: write unix @->/run/user/1000/bus: write: broken pipe
scrcpy 1.25 https://github.com/Genymobile/scrcpy
No protocol specified
Segmentation fault (core dumped)
解决方案
检查 D-Bus 服务:
确保 D-Bus 服务正在运行。你可以尝试重新启动 D-Bus 服务:
systemctl --user restart dbus
检查 D-Bus 的状态:
systemctl --user status dbus
检查 X11 权限:
确保你的用户有访问 X11 的权限。尝试运行以下命令:
xhost +local:
确保 DISPLAY 环境变量正确设置。例如:
export DISPLAY=:0
检查 scrcpy 版本和依赖:
确保 scrcpy 的版本和依赖库是最新的。你可以尝试升级 scrcpy:
sudo apt update
sudo apt install scrcpy
如果你是从源码编译的,确保依赖项都已经正确安装。
检查系统日志和 core dump 文件:
查看系统日志以获取更多信息:
journalctl -xe
查看 core dump 文件,分析崩溃原因。Core dump 文件通常在 /var/crash 或 /core 中,可以使用调试工具如 gdb 分析:
gdb /path/to/scrcpy /path/to/core
如果以上步骤都无法解决问题,考虑重新安装 scrcpy 或寻求进一步的支持。