1

I'm getting very contradicting messages trying to run scrcpy wirelessly.

$ adb connect 192.168.1.200:5555
connected to 192.168.1.200:5555
$ adb devices
List of devices attached
192.168.1.200:5555  device

$ scrcpy
scrcpy 1.24 <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

$ scrcpy --tcpip
scrcpy 1.24 <https://github.com/Genymobile/scrcpy>
ERROR: Could not find any ADB device
ERROR: Server connection failed

$ adb devices
adb server version (39) doesn't match this client (41); killing...
* daemon started successfully
List of devices attached

At some point I succeeded to connect and run scrcpy. I disconnected and tried to run it again but no luck this time. I can't wrap my head around what's causing this.

$ whereis adb
adb: /usr/bin/adb /usr/share/man/man1/adb.1.gz

$ adb version
Android Debug Bridge version 1.0.41
Version 28.0.2-debian
Installed as /usr/lib/android-sdk/platform-tools/adb

I connected via USB to reenable adb over TCP/IP. Device IP doesn't show up. Previously device ID and IP were listed.

$ scrcpy --tcpip
scrcpy 1.24 <https://github.com/Genymobile/scrcpy>
INFO: Switching device J6AXB763C036R6E to TCP/IP...
ERROR: Device IP not found
ERROR: Server connection failed
$ adb tcpip 5555
adb server version (39) doesn't match this client (41); killing...
* daemon started successfully
restarting in TCP mode port: 5555
$ adb devices
List of devices attached
J6AXB763C036R6E device

I tried again and failed.

$ adb kill-server
$ adb start-server
* daemon not running; starting now at tcp:5037
* daemon started successfully
$ adb devices
List of devices attached

$ adb connect 192.168.1.200:5555
connected to 192.168.1.200:5555
$ adb devices
List of devices attached
192.168.1.200:5555  device

$ scrcpy
scrcpy 1.24 <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
1
  • What output do you get by the command /usr/bin/adb --version? -> Please edit your question and add the output there not here in comments.
    – Robert
    Sep 25, 2022 at 13:09

2 Answers 2

0

Some scrcpy distributions include an own adb version. If on your system adb is already present e.g. because you have installed Android SDK or a different tool that includes adb this can result in a adb version conflict as you have noticed.

To resolve this issue you can create the environment variable ADB and in it specify the path to the adb binary you want to use with scrcpy.

I assume on your system the newest adb version is the one installed to /usr/bin/adb so executing

export ADB=/usr/bin/adb 

should solve your problem.

Windows users can do the same and add a new environment variable ADB that points to the latest adb.exe that should be used.

10
  • adb wasn't installed with scrcpy. Nevertheless, I've done what you suggested. Here is what happened. Sep 25, 2022 at 12:59
  • $ export ADB=/usr/bin/adb $ adb connect 192.168.1.200:5555 adb server version (39) doesn't match this client (41); killing... * daemon started successfully connected to 192.168.1.200:5555 Sep 25, 2022 at 13:00
  • $ scrcpy scrcpy 1.24 <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 Sep 25, 2022 at 13:00
  • @Pavel But you have multiple adb versions present on your system. You should find them and only keep one adb version (usually the latest).
    – Robert
    Sep 25, 2022 at 13:05
  • I can't find multiple versions. Only one. Sep 25, 2022 at 13:07
0

For future readers who might have this problem and are using Ubuntu OS, do as @Robert said. You just have to:

  1. Remove the one in the OS: apt remove adb
  2. Then get the path of your adb: which adb
    For me, it was /home/bilal/Android/Sdk/platform-tools/adb because I had Android Studio installed
  3. Then export ADB=/home/bilal/Android/Sdk/platform-tools/adb
  4. And voila, scrcpy should work
1
  • don't have enough reputation to upvote @Robert answer, incase your are wondering why i didn't
    – mbakabilal
    Jul 25, 2023 at 23:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .