Scrcpy: How to use SSH tunnel connect remote devices??

Created on 19 Aug 2020  Â·  6Comments  Â·  Source: Genymobile/scrcpy

I have two PC named A and B

PC B: connect mobile with adb

PC A :
run adb kill-server

and run ssh -CN -L5037:localhost:5037 -R27183:localhost:27183 administrator@PC_B_IP

then I run scrcpy from A‘s another terminal

but it does not work, and return

2020-08-19 20:20:35.349 scrcpy[62010:1043826] INFO: scrcpy 1.16 <https://github.com/Genymobile/scrcpy>
adb: error: failed to get feature set: protocol fault (couldn't read status): Undefined error: 0
2020-08-19 20:20:37.851 scrcpy[62010:1043826] ERROR: "adb push" returned with value 1

Is my operation method correct? How to connect the remote device correctly

Most helpful comment

I resolved this problem
both local and remote are Windows10

1. adb kill-server (local & remote)
2. ssh -CN -L5037:127.0.0.1:5037  -R27183:127.0.0.1:27183   administrator@remoteIP  (local)
3. adb devices(remote)
4. scrcpy(local)

the key point is to use '127.0.0.1' replace ‘localhost’ in the ssh command

All 6 comments

What is the result of adb --version on both computers?

A is MacOS, adb --version

Android Debug Bridge version 1.0.40
Version 4986621

B is WIndows10, adb --version

Android Debug Bridge version 1.0.41
Version 30.04-6686687

That's probably the cause of:

protocol fault

You need the same version so that they talk the same protocol.

OK,thanks, I'll try it later

I change A to Windows , and adb version as same as B
and get the new error info:

INFO: scrcpy 1.16 <https://github.com/Genymobile/scrcpy>
adb: error: failed to get feature set: protocol fault (couldn't read status): No error
ERROR: "adb push" returned with value 1
Press any key to continue...

adb --version

Android Debug Bridge version 1.0.41
Version 30.0.4-6686687

I resolved this problem
both local and remote are Windows10

1. adb kill-server (local & remote)
2. ssh -CN -L5037:127.0.0.1:5037  -R27183:127.0.0.1:27183   administrator@remoteIP  (local)
3. adb devices(remote)
4. scrcpy(local)

the key point is to use '127.0.0.1' replace ‘localhost’ in the ssh command

Was this page helpful?
0 / 5 - 0 ratings

Related issues

targor picture targor  Â·  3Comments

fernandofreamunde picture fernandofreamunde  Â·  4Comments

tonypachino picture tonypachino  Â·  3Comments

sennight picture sennight  Â·  3Comments

npes87184 picture npes87184  Â·  3Comments