我使用以下命令使用scrcpy远程控制我的手机:
adb kill-server ; adb connect (my phone's IP address):5555 ; scrcpy --prefer-text --serial (my phone's IP address)
它的运行没有问题,在终端和程序启动,以便我可以使用它。但是,当我使用桌面启动程序运行相同的命令时,终端会立即打开并关闭,程序不会启动(我已经在启动器属性中启用了“运行终端”)。我该怎么做才能让它发挥作用?
下面是在终端中运行命令时得到的输出:
* daemon not running; starting now at tcp:5037
* daemon started successfully
connected to (my phone's IP address):5555
INFO: scrcpy 1.12.1 <https://github.com/Genymobile/scrcpy>
/usr/share/scrcpy/scrcpy-server: 1 file pushed. 0.9 MB/s (24773 bytes in 0.026s)
error: more than one device/emulator
ERROR: "adb reverse" returned with value 1
WARN: 'adb reverse' failed, fallback to 'adb forward'
INFO: Initial texture: 720x1280
发布于 2020-07-18 00:49:10
启动程序可能将整个字符串作为单个命令来处理。在您的示例中,adb
(... ; ... ; ...
)后面的所有内容都作为参数处理,而不是作为单独的命令执行。要解决这个问题,请使用bash -c
。
bash -c "adb kill-server ; adb connect 0.0.0.0:5555 ; scrcpy --prefer-text --serial 0.0.0.0"
https://askubuntu.com/questions/1259995
复制相似问题