We connect to remote adb devices using env variable ADB_SERVER_SOCKET ( same as -L option of adb but using ENV variable instead)
looks like scrcpy does not recognize this. It pushed the file to the remote device and thereafter just stuck. It will be great if that can be supported. Or is there any other way to access the remote device using scrcpy?
$ adb kill-server
$ adb -P1234 start-server
$ export ADB_SERVER_SOCKET=tcp:localhost:1234
$ scrcpy
It seems to work…
is there any other way to access the remote device using scrcpy?
https://www.genymotion.com/blog/open-source-project-scrcpy-now-works-wirelessly/
It works with localhost but not with a remote host.
Here is what I did
On laptop 1
adb kill-server
adb -a -P 5037 nodaemon server >/tmp/adblog 2>&1 &
On laptop 2
export ADB_SERVER_SOCKET=tcp:<ip_of_laptop_1>:5037
check adb devices shows the device
➜ ~ scrcpy
/usr/local/Cellar/scrcpy/1.1_1/share/scrcpy/scrcpy-server.jar: 1 file pushed. 0.4 MB/s (19334 bytes in 0.044s)
And there is no output and no UI after that
And there is no output and no UI after that
Could you try on current master, please? (see https://github.com/Genymobile/scrcpy/issues/5#issuecomment-373721710)
Even I am not able to see output when I am trying to connect to remote server.
Followed same steps as highlighted by rajdeepv
failed to connect to socket 'tcp:27183': Connection refused
I just tried and reproduced. In fact, this is "expected": the adb reverse redirects a port between the device and the remote adb, while scrcpy connects to that port locally. This may not work.
You need, in addition, to redirect remote 27183 to local 27183 (which is not related to adb).
Using SSH, you can enable both redirections. From the local computer:
adb kill-server # kill the local adb server on 5037
ssh -CN -L5037:localhost:5037 -R27183:localhost:27183 your_remote_computer
# keep this open
From another terminal on the local computer:
scrcpy
I added a new option --force-adb-forward to avoid a SSH remote port forwarding: 8f46e184262aebb3a420571de73520d60ccdfbd0
Most helpful comment
I just tried and reproduced. In fact, this is "expected": the
adb reverseredirects a port between the device and the remote adb, whilescrcpyconnects to that port locally. This may not work.You need, in addition, to redirect remote 27183 to local 27183 (which is not related to adb).
Using SSH, you can enable both redirections. From the local computer:
From another terminal on the local computer: