scrcpy: adb server version (41) doesn't match this client (40)

I’m facing this error starting from today:

adb server version (41) doesn't match this client (40); killing...
ADB server didn't ACK
Full server startup log: /var/folders/0q/jh77wwcx1cs989k89kv79mqr0000gn/T//adb.501.log
Server had pid: 34316
--- adb starting (pid 34316) ---
adb I 05-09 21:30:11 34316 4407796 main.cpp:56] Android Debug Bridge version 1.0.40
adb I 05-09 21:30:11 34316 4407796 main.cpp:56] Version 28.0.2-5303910
adb I 05-09 21:30:11 34316 4407796 main.cpp:56] Installed as /usr/local/bin/adb
adb I 05-09 21:30:11 34316 4407796 main.cpp:56] 
adb I 05-09 21:30:11 34316 4407799 usb_osx.cpp:308] reported max packet size for ce061716d90b602a027e is 512
adb I 05-09 21:30:11 34316 4407796 auth.cpp:405] adb_auth_init...
adb I 05-09 21:30:11 34316 4407802 transport.cpp:283] ce061716d90b602a027e: read thread spawning
adb I 05-09 21:30:11 34316 4407803 transport.cpp:296] ce061716d90b602a027e: write thread spawning
adb I 05-09 21:30:11 34316 4407796 transport.cpp:1334] fetching keys for transport ce061716d90b602a027e
adb I 05-09 21:30:11 34316 4407796 auth.cpp:457] Calling send_auth_response
adb I 05-09 21:30:11 34316 4407796 adb.cpp:114] ce061716d90b602a027e: offline
adb server killed by remote request
adb I 05-09 21:30:14 34316 4407796 transport.cpp:339] BlockingConnectionAdapter(ce061716d90b602a027e): stopping
adb I 05-09 21:30:14 34316 4407796 usb_osx.cpp:561] Kicking handle
adb E 05-09 21:30:14 34316 4407802 usb_osx.cpp:541] usb_read failed with status: e00002eb
adb I 05-09 21:30:14 34316 4407802 transport.cpp:287] ce061716d90b602a027e: read failed: Undefined error: 0
adb I 05-09 21:30:14 34316 4407802 transport.cpp:676] ce061716d90b602a027e: connection terminated: read failed
adb I 05-09 21:30:14 34316 4407796 transport.cpp:357] BlockingConnectionAdapter(ce061716d90b602a027e): stopped

* failed to start daemon
adb: error: failed to get feature set: cannot connect to daemon
2019-05-09 21:30:14.285 scrcpy[34314:4407786] ERROR: "adb push" returned with value 1

I attached the content of /var/folders/0q/jh77wwcx1cs989k89kv79mqr0000gn/T//adb.501.log adb.501.log

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 61

Most upvoted comments

So you have several adb versions running. Something on your system starts (and seems to restart when it dies) the server with adb 41.

And scrcpy uses your adb 40.

What is the result of adb version? Find where your adb 41 binary is, and you can force it:

ADB=/path/to/some/adb scrcpy

A better way would be to change your PATH so that it always finds the right adb.

fixed this by doing the following:

going into GenyMotion settings -> ADB tab, instead of Use Genymotion Android tools (default), I chose Use custom Android SDK Tools and then browsed to my installed SDK.

Hi, what worked for me.

My Android Studio has an adb file inside /home/myuser/Android/Sdk/platform-tools/ and with the version 1.0.41.

Note where I put myuser could be your name, whatever, just locate your Android path.

My error was: adb server version (41) doesn’t match this client (39)

When you type just adb in terminal, this command will be related with the adb archive inside /usr/bin.

So, I did these steps inside terminal:

  1. adb version Android Debug Bridge version 1.0.39
  2. cd /usr/bin
  3. sudo rm adb
  4. cd /home/myuser/Android/Sdk/platform-tools/
  5. Please check if there is an adb file inside your path
  6. Now copy to /usr/bin sudo cp adb /usr/bin
  7. adb version again Android Debug Bridge version 1.0.41

With this done, right now I have the same adb file to both of them, so, if in the future the SDK Manager ask to upgrade platform-tools, remember to do it again if the error back to appear.

I also encountered this issue because the Android SDK platform tools had a different version of adb then scrcpy.

$ scrcpy.adb version
Android Debug Bridge version 1.0.39
Version 1:8.1.0+r23-5~18.04
Installed as /snap/scrcpy/174/usr/lib/android-sdk/platform-tools/adb
$ adb version
Android Debug Bridge version 1.0.41
Version 29.0.5-5949299

I added the environmental variable for ADB and it resolved the issue.

~/.bashrc
export ADB=/home/sudhir/Documents/Android/android-sdk/platform-tools/adb

source ~/.bashrc or logout/login and the error go away.

Capture Capture2

Hi all, replace 3 files in “scrcpy” folder by their version in “platform-tools” maybe work.

I hope this will be useful !!!

It work for me

  1. adb version Android Debug Bridge version 1.0.39 Version 1:8.1.0+r23-5 Installed as /usr/lib/android-sdk/platform-tools/adb
  2. adb kill-server
  3. ps ax | grep adb 12290 ? S 0:00 /home/usuario/Android/Sdk/platform-tools/adb devices -l 12291 ? Ssl 0:00 adb -L tcp:5037 fork-server server --reply-fd 7 12332 pts/1 S+ 0:00 grep --color=auto adb
  4. cd /home/usuario/Android/Sdk/platform-tools
  5. mv adb adbxxx
  6. ln -s /usr/lib/android-sdk/platform-tools/adb adb
  7. Restart Android Studio

Oh, but your problem is the reverse:

adb server version (40) doesn’t match this client (41);

You correctly uses v41, but some app on your computer executes adb commands with adb v40. You must find this app and stop it 😉

It’s ok. But is better to do simlink to the folder directly and then, when sdk upgrade is’nt to make changes.

Enviado desde Yahoo Mail para Android

El sáb., 11 de abr. de 2020 a la(s) 12:41, jonnimouranotifications@github.com escribió:

Hi, what worked for me.

My Android Studio has an adb file inside /home/myuser/Android/Sdk/platform-tools/ and with the version 1.0.41.

Note where I put myuser could be your name, whatever, just locate your Android path.

My error was: adb server version (41) doesn’t match this client (39)

When you type just adb in terminal, this command will be related with the adb archive inside /usr/bin.

So, I did these steps inside terminal:

  • adb version
    Android Debug Bridge version 1.0.39
  • cd /usr/bin
  • sudo rm adb
  • cd /home/myuser/Android/Sdk/platform-tools/
  • Please check if there is an adb file inside your path
  • Now copy to /usr/bin
    sudo cp adb /usr/bin
  • adb version again
    Android Debug Bridge version 1.0.41

With this done, right now I have the same adb file to both of them, so, if in the future the SDK Manager ask to upgrade platform-tools, remember to do it again if the error back to appear.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

still doesnt work for me on ubuntu.

Link in Stack Overflow

Got a quick way to do it First sudo rm /usr/bin/adb

Then sudo ln -s /home/{{username}}/Android/Sdk/platform-tools/adb /usr/bin/adb Fastest way to fix the issue

On Linux with GNOME, is possible to edit the .desktop file and set the ADB environment variable in that. Example:

Exec=env ADB=$(which adb) guiscrcpy

Another option is use the Alacarte to do this. In this case the Exec part can be omitted.

env ADB=$(which adb) guiscrcpy

scrcpy

The idea is to set the environment variable ADB (which is read by scrcpy).

In a shell (typically on linux), you can set the variable for a single command:

VAR=value command

On Windows, you can set it globally in Windows preferenced, but you can also set it locally:

set VAR=value
command

So:

set ADB=C:\path\to\adb.exe
scrcpy

yes, when i use adb devices on cmd i have this error… who use other adv v40??? i think visual studio code… but no! it dont find phone for the same problem like Android studio!

ehmmmmm yes probably yess… i cannot understand why; when i start to play emulator on Android Studio; and if there is my phone on usbCable… all process go in error!!!

It work for me

  1. adb version Android Debug Bridge version 1.0.39 Version 1:8.1.0+r23-5 Installed as /usr/lib/android-sdk/platform-tools/adb
  2. adb kill-server
  3. ps ax | grep adb 12290 ? S 0:00 /home/usuario/Android/Sdk/platform-tools/adb devices -l 12291 ? Ssl 0:00 adb -L tcp:5037 fork-server server --reply-fd 7 12332 pts/1 S+ 0:00 grep --color=auto adb
  4. cd /home/usuario/Android/Sdk/platform-tools
  5. mv adb adbxxx
  6. ln -s /usr/lib/android-sdk/platform-tools/adb adb
  7. Restart Android Studio

thanks for you , it worked will

I’d expect that proper implementation should prefer adb available from PATH if any, and otherwise fallback to bundled one

That’s what scrcpy does (it just calls adb, so it ends up using the one in PATH).

The problem is that snap runs scrcpy in some “container”, where the PATH is different.

So by setting ADB=$(which adb), you force a specific adb path, calculated from the shell (without snap “containerization”).

I’d like to confirm, that the adb bundled in snap (scrcpy.adb) with scrcpy is the problem. forcing to use system-wide adb with ADB=$(which adb) solves the issue.

I’d expect that proper implementation should prefer adb available from PATH if any, and otherwise fallback to bundled one

When you encounter this problem, I suggest to use a non-snap version. For example, you could build the client: https://github.com/Genymobile/scrcpy/blob/master/BUILD.md#prebuilt-server

/home/uzairleo/Pictures/error.png

@rom1v ThankYouVeryMuch Romain… i solve all my problem… with your help i understand that i have installed one software to deploy screen of windows over android tablet (https://www.splashtop.com/wiredxdisplay)… this software turn on his version of ADB and make “casino” with androdiStudio version!! thank… i need to upgrade my capacity to understand 😉