Open Songchunbo opened 3 weeks ago
Over SSH, you won't have a display by default. Even if you forwarded display via SSH (ssh -X
), this is not what you want: you want to transmit the compressed video stream, not the image to display.
For that purpose, read https://github.com/Genymobile/scrcpy/blob/master/doc/tunnels.md#ssh-tunnel
Thanks, rom1v. I think SSH tunnel forward is correct way in my scenario.
I followed the SSH tunnel guide and made the tests with a Pixel device. However, the connection appears to be unstable. Initially, the device screen is displayed correctly during the first two attempts, but subsequent tries result in it being blocked. Is there any log to check the block reason?
****************************first try********************************
(base) % export ADB_SERVER_SOCKET=tcp:localhost:5038
(base) % scrcpy
scrcpy 2.4 <https://github.com/Genymobile/scrcpy>
INFO: ADB device found:
INFO: --> (usb) FA68R0309644 device Pixel
/opt/homebrew/Cellar/scrcpy/2.4/share/scrcpy/scrcpy-server: 1 file pushed. 3.5 MB/s (69007 bytes in 0.019s)
[server] INFO: Device: [Google] google Pixel (Android 10)
[server] WARN: Audio disabled: it is not supported before Android 11
INFO: Renderer: metal
WARN: Demuxer 'audio': stream explicitly disabled by the device
INFO: Texture: 1080x1920
^CWARN: Device disconnected
****************************second try********************************
(base) % scrcpy
scrcpy 2.4 <https://github.com/Genymobile/scrcpy>
INFO: ADB device found:
INFO: --> (usb) FA68R0309644 device Pixel
/opt/homebrew/Cellar/scrcpy/2.4/share/scrcpy/scrcpy-server: 1 file pushed. 2.3 MB/s (69007 bytes in 0.029s)
[server] INFO: Device: [Google] google Pixel (Android 10)
[server] WARN: Audio disabled: it is not supported before Android 11
INFO: Renderer: metal
WARN: Demuxer 'audio': stream explicitly disabled by the device
INFO: Texture: 1080x1920
^CWARN: Device disconnected
****************************third try********************************
(base) % scrcpy
scrcpy 2.4 <https://github.com/Genymobile/scrcpy>
INFO: ADB device found:
INFO: --> (usb) FA68R0309644 device Pixel
/opt/homebrew/Cellar/scrcpy/2.4/share/scrcpy/scrcpy-server: 1 file pushed. 3.1 MB/s (69007 bytes in 0.021s)
[server] INFO: Device: [Google] google Pixel (Android 10)
[server] WARN: Audio disabled: it is not supported before Android 11
Environment
Describe the bug
I have a Ubuntu host directly connected to a Pixel device via usb cable. It's normal to use scrcpy from the Ubuntu console. When connected, the console displays the following.
When I SSH into the Ubuntu host from MacOS via iTerm and then try to use scrcpy, it complains with the following errors.
So, is it possible to remotely use scrcpy from MacOS to access the Pixel device connected with Ubuntu host? or some packages I missed in MacOS?