scrcpy icon indicating copy to clipboard operation
scrcpy copied to clipboard

scrcpy over Wi-Fi - could not find ADB device

Open bmscmoreira opened this issue 2 years ago • 4 comments

  • [x] I have read the FAQ.
  • [x] I have searched in existing issues.

Environment

  • OS: Raspberry OS 64bit (latest from 04-04-2022)
  • scrcpy version: 1.23
  • installation method: snap
  • device model: Poco F3
  • Android version: MIUI Global 13.0.4

Describe the bug When starting scrcpy, even with device connected via ADB TCPIP, results in connection error (could not find ADB device)

NOTE: the first adb devices command was issued with the USB cable plugged in; then I removed the USB cable and issued the command again, and the device was still connected. If I leave USB cable plugged in, scrcpy works fine.

Please paste terminal output in a code block.

bmscmoreira@raspberrypi:~ $ adb tcpip 5555
restarting in TCP mode port: 5555

bmscmoreira@raspberrypi:~ $ adb connect 192.168.9.42:5555
connected to 192.168.9.42:5555

bmscmoreira@raspberrypi:~ $ adb devices
List of devices attached
94606463	device
192.168.9.42:5555	device

bmscmoreira@raspberrypi:~ $ adb devices
List of devices attached
192.168.9.42:5555	device

bmscmoreira@raspberrypi:~ $ scrcpy
scrcpy 1.23 <https://github.com/Genymobile/scrcpy>
adb server version (41) doesn't match this client (39); killing...
* daemon started successfully
ERROR: Could not find any ADB device
ERROR: Server connection failed

bmscmoreira avatar Apr 24 '22 16:04 bmscmoreira

adb server version (41) doesn't match this client (39); killing...

It uses a different adb, because snap.

You could try:

ADB=$(which adb) scrcpy

Or don't use the snap version.

FYI, you could use scrcpy --tcpip while your device is plugged.

rom1v avatar Apr 24 '22 16:04 rom1v

Thank you for the reply. Not sure how it worked, since I'm given several info/warn/error messages on the terminal, but this sequence of commands worked for me (using snap version):

Starting with USB cable plugged in:

adb tcpip 5555 adb connect IP:5555 scrcpy --tcpip scrcpy -e

Then removed the USB cable.

bmscmoreira avatar Apr 25 '22 09:04 bmscmoreira

Using scrcpy --tcpip worked. Thanks

ben-mathu avatar Jun 18 '22 06:06 ben-mathu

adb server version (41) doesn't match this client (39); killing...

It uses a different adb, because snap.

You could try:

ADB=$(which adb) scrcpy

this won't work if adb is in a standard path like /usr/bin, which is not mounted inside the snap container:

$ ADB=/usr/bin/adb scrcpy
scrcpy 1.24 <https://github.com/Genymobile/scrcpy>
exec: No such file or directory
ERROR: Command not found: [/usr/bin/adb], [start-server]
ERROR: (make 'adb' accessible from your PATH or define its fullpath in the ADB environment variable)
INFO: You may install 'adb' by "apt install adb"
ERROR: Could not execute "adb start-server"
ERROR: Could not start adb daemon
ERROR: Server connection failed

in such a case you should move or copy adb somewhere in your HOME (which is mounted inside the snap container) and then pass the new adb path to scrcpy:

ADB=/home/<user>/<adb path> scrcpy

masavini avatar Jun 21 '22 10:06 masavini