adb server version doesn't match this client
Asked Answered
J

41

167

Whenever I try to run adb devices:

            $ adb devices
            * daemon not running. starting it now *
            * daemon started successfully *
            List of devices attached
            HT0ANRV05740    device

It says daemon is not running and restarts the daemon.

Then, if I run adb devices again, it does the same thing -

            $ adb devices
            adb server is out of date.  killing...
            * daemon started successfully *
            List of devices attached
            HT0ANRV05740    device

Then, if I run it again, it again does the exact same thing -

            $ adb devices
            adb server is out of date.  killing...
            * daemon started successfully *
            List of devices attached
            HT0ANRV05740    device

Please help!!

Also, my DDMS keeps giving me the following message -

[2011-02-23 16:17:05 - DeviceMonitor]Adb connection Error:An existing connection was forcibly closed by the remote host

Here are the logs from just before adb restarts -

              1291        locapi_rpc_glue  V  loc_ioctl
              1291                    RPC  D  written RPC packet size: [480]
              1291                    RPC  D  read RPC packet
              1291                    RPC  D  read RPC packet size: [28]
              1291             lib_locapi  V  qct_loc_eng_inject_xtra_data, inject part = 100, len = 167, len = 167
              1291             lib_locapi  V  qct_loc_eng_inject_xtra_data, total part = 100, len = 167
              1291        locapi_rpc_glue  V  loc_ioctl
              1291                    RPC  D  written RPC packet size: [248]
              1291                    RPC  D  read RPC packet
              1291                    RPC  D  read RPC packet size: [28]
              1291             lib_locapi  D  qct_loc_eng_inject_xtra_data: injected 39767, SUCCESS
              1291             lib_locapi  V  inject_xtra_waiting = flase
              1291    GpsLocationProvider  D  Releasing wakelock
              1291            WifiService  D  releaseWifiLockLocked: WifiLock{NetworkLocationProvider type=2 binder=android.os.Binder@47aead50}
              1291            WifiService  D  enable and start wifi due to updateWifiState
              1218            rmt_storage  I  rmt_storage open event
              1218            rmt_storage  I  rmt_storage client thread started
              1218            rmt_storage  I  rmt_storage events processing done
              1218            rmt_storage  I  rmt_storage register cb event
              1218            rmt_storage  I  rmt_storage status id = 2
              1218            rmt_storage  I  rmt_storage events processing done
              1218            rmt_storage  I  rmt_storage open event
              1218            rmt_storage  I  rmt_storage client thread started
              1218            rmt_storage  I  rmt_storage events processing done
              1218            rmt_storage  I  rmt_storage register cb event
              1218            rmt_storage  I  rmt_storage status id = 2
              1218            rmt_storage  I  rmt_storage events processing done
              1218            rmt_storage  I  rmt_storage write event
              1218            rmt_storage  I  unblock rmt_storage client thread
              1218            rmt_storage  I  rmt_storage events processing done
              1218            rmt_storage  I  rmt_storage write: bytes written = 3145216
              1218            rmt_storage  I  rmt_storage write: bytes written = 512
              1218            rmt_storage  I  rmt_storage status handle = 1
              1291       BatteryStatsImpl  I  notePhoneSignalStrengthLocked: 4->3
              1218            rmt_storage  I  rmt_storage write event
              1218            rmt_storage  I  rmt_storage events processing done
              1218            rmt_storage  I  unblock rmt_storage client thread
              1291    PowerManagerService  D  New lightsensor value:40, lcdValue:143
              1291    PowerManagerService  D  lightSensorChangedLocked, buttonValue >= 0, mPowerState = 3
              1218            rmt_storage  I  rmt_storage write: bytes written = 3145216
              1218            rmt_storage  I  rmt_storage write: bytes written = 512
              1218            rmt_storage  I  rmt_storage status handle = 2
              1291                    RPC  D  read RPC packet
              1291                    RPC  D  read RPC packet size: [80]
              1291        locapi_rpc_glue  V  Callback received: 80 (cb_id=0x50B0000 handle=1)
              1291                    RPC  D  written RPC packet size: [28]
              1470   usicWidgetController  D  unbindMusicPlaybackService()
              1707   MediaPlaybackService  E  BadQueue mPlayListLen : 0 mAlbumListLen : 0 mShrinkAlbumListLen : 0
              1291    NotificationService  V  Battery Full, Charging
              1291                 lights  E  write ok string=0,len=1
              1291                 lights  E  write ok string=0,len=1
              1291                 lights  E  write ok string=0 0,len=3
              1291                 lights  E  write ok string=1,len=1
              1707       MediaPlayer.java  D  setOnCompletionListener being cleaned to null
              1291                 lights  E  write ok string=0,len=1
              1291                 lights  E  write ok string=0 0,len=3
              1291    NotificationService  V  Turn off Jogball/OJ LED
              1291    NotificationService  D  cancelNotification, ACTION_NOTIFICATION_REMOVE,pkg=com.htc.music,id=1
              1291           AudioService  I   AudioFocus  abandonAudioFocus() from android.media.AudioManager@476ddee0com.htc.music.MediaPlaybackService$5@476dd838
Justus answered 23/2, 2011 at 14:57 Comment(6)
For me, helped exitting Helium desktop app, which have own adb version. :)Putup
In my case it was Genymotion, there's a configuration to use their own version or you can set your own.Reimers
https://mcmap.net/q/130451/-adb-server-is-out-of-date-killing-duplicateCommuter
In aosp I renamed aosp/out/host/darwin-x86/bin/adb to adb-aosp because aliasing on top of that to my local (out of AOSP) version wasn't working.Depth
Many different ADB server version (XX) doesn't match this client (YY) link to this question while I think they are not nessesarily duplicates. Please consider android.stackexchange.com/questions/232859/… (I didn't find a soultion in the other Q/A)Giavani
Also, if you're absolutely stuck like I was, try a different host device or new installation instead of giving up! → android.stackexchange.com/a/234460/340401Giavani
J
65

I uninstalled Dell PC Suite and HTC Sync from my computer and this problem went away.

EDIT: To elaborate a bit on the cause of this problem: HTC sync comes with an ADB server of its own. And it updates your PATH environment variable to point to its version of the server. Edit the PATH variable and remove the reference to the HTC Sync directories. Now you're using Google's ADB again.

Justus answered 13/3, 2011 at 13:4 Comment(4)
This problem is in my mac os-x apple device.Backstitch
HTC Sync was the issue. It continuously runs in the background, causing conflicts with adb.exeClog
LG AirBridge caused the problem for me - uninstalling that and then running adb start-server worked.Removal
As developer, I need the HTC USB drivers that are bundled with the HTC Sync Manager. This is the only case for Windows 10, which is the OS I'm using. After installation, HTC Sync will run and continuously run in the background. You want to open Task Manager > Services tab, and then turn off HTCMonitorService background task. This will prevent HTC Sync from conflicting with Google ADB, and will also prevent Google ADB from locking up when HTC devices are connected to the PC.Ooze
N
301

Are you using Genymotion for a virtual device?

if yes this error probably came out because ADB from Genymotion conflicted with your ADB from Android SDK(using same port number), to fix this simply go to settings => choose ADB tab => click on the option Use custom Android SDK Tools and set your SDK folder

enter image description here

after you configure this, try to restart your adb by going into folder platform-tools which adb placed and do this command:

  • ./adb kill-server
  • ./adb start-server

*tips: You may close the process of Genymotion before running the command above

Hope this help.

Natheless answered 5/11, 2014 at 17:48 Comment(10)
Thank You Aditya!!! finally a decent answer. It started after updating android studio. I was going crazy with this one, reinstalled the sdk and everything. I thought it was a bug in the new version.Logistics
Only this helped ! There's a tiny tool called 'adbfix', which gave me the hint that this could be a path related problem, but actually did nothing to fix the problem.Holder
Gotta love Genymotion as stock emulators consume too much resources as they are constantly heating up my beatup laptop running on Ubuntu.Centromere
I do not have genymotion installed in my system. How do I fix this?Decker
This is great, thank you! Just to add quit GenyMotion (the device launcher and the any open simulators) before calling the adb commandsDematerialize
Any genymotion emulator must be closed before running commands above.Struthious
Thank you! :) I used Gennymotion emulator. "adb devices" command worked again. :pNatascha
@Struthious and all of you mates: I did as instructed, but after starting GenyMotion the issue persist and i can't see any devices in 'List of Devices' Below is the result i get on CMD: adb server is out of date. killing... ADB server didn't ACK * failed to start daemon * error:Devora
@GauravLad have you check the port number that used by adb (port: 5037) ? maybe any other process was running with the same port number and it's not genymotionNatheless
@AdityaKresnaPermana I'm getting this error even though I've configured Genymotion to use custom SDK tools (Android SDK) . Is there anyway to fix that ?Incunabula
J
65

I uninstalled Dell PC Suite and HTC Sync from my computer and this problem went away.

EDIT: To elaborate a bit on the cause of this problem: HTC sync comes with an ADB server of its own. And it updates your PATH environment variable to point to its version of the server. Edit the PATH variable and remove the reference to the HTC Sync directories. Now you're using Google's ADB again.

Justus answered 13/3, 2011 at 13:4 Comment(4)
This problem is in my mac os-x apple device.Backstitch
HTC Sync was the issue. It continuously runs in the background, causing conflicts with adb.exeClog
LG AirBridge caused the problem for me - uninstalling that and then running adb start-server worked.Removal
As developer, I need the HTC USB drivers that are bundled with the HTC Sync Manager. This is the only case for Windows 10, which is the OS I'm using. After installation, HTC Sync will run and continuously run in the background. You want to open Task Manager > Services tab, and then turn off HTCMonitorService background task. This will prevent HTC Sync from conflicting with Google ADB, and will also prevent Google ADB from locking up when HTC devices are connected to the PC.Ooze
L
35

I find I occasionally need to explicitly kill and restart the server manually:

adb kill-server
adb start-server

This shock is generally enough to get it back on its feet again, and prevents repeated adb server is out of date. killing... messages.

Lema answered 23/2, 2011 at 16:4 Comment(2)
Killing and restarting seems to have worked for me; however I am now getting the error message "error: more than one device and emulator" when I do: "adb tcpip 5555" as per accepted answer's instructions.Gingili
In my case, there are multiple processes of adb running so I do multiple calls to adb kill-server until it says" daemon not running..."Silvertongued
M
26

Ensure that there are no other adb processes running

There may be more than one adb process running on the system. Tools such as the Android Reverse Tether may use their own version of the adb tool, hence the version in memory may conflict with the version run from the command line (via the path variable).

Windows

In Windows, press CTL+Shift+ESC to access Task Manager, sort in the Image Name column, then kill all instances of adb.exe by right-clicking, and choosing End Process. Note that there are multiple instances of adb.exe below:

Multiple adb.exe instances - how to kill

Linux (Android)

In a Linux environment, just use the kill -9 command. Something like this worked on an Android device running adb (use ps output, search using grep for a process starting with adb, get the Process ID from the adb process(es), and send that ID to the kill -9 command):

kill -9  $(ps  | grep "S adb" | busybox awk '{print $2}')

Then, restart adb

Once the adb processes - and thus conflicts - are resolved, then retry running adb from the command-line again:

adb start-server
Munda answered 30/3, 2015 at 23:32 Comment(1)
In my case, I found out that another instance of adb was running as part of GapDebug. Stopping GapDebug, killing the running adb process and calling ./adb start-server in ~/Library/Android/sdk//platform-tools solved it.Suffolk
V
26

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

Vaginate answered 2/7, 2019 at 20:0 Comment(5)
Cant believe i had the same issue and i came to get the answer from myself againVaginate
This is truly the fastest way!! Thanks!Pineal
i believe this is the way to go for most linux distros.Fervidor
Somehow I wound up with an adb in /usr/lib/android-sdk/platform-tools and I have no idea where it came from. Everything was fine until today, and that alternate adb says it was installed in 2019... must be ghosts? #justlinuxthingsKitti
This really is the fastest way!Leontina
H
22

This is caused because you are running a adb other than the one included in the SDK. If on linux check where is the adb binary located

which adb
Expected Output : ANDROID_SDK/platform-tools/adb

If not pointing to ANDROID_SDK/platform-tools/adb then you are running some old version of adb installed on a different location on the machine.

Nothing wrong running adb other than the one provided with SDK but the downside is it is not updated automatically when the android SDK is updated and that's why you running into this out-dated version issue.

The easier fix and to avoid this issue in future rename the older (misleading) adb binary file to something else.

Follow the steps to resolve this issue.

$ which adb
*o/p /usr/bin/adb  -   (output will depend on your machine)*
$ cd /usr/bin/
$ ls -lt | grep adb
*o/p -rwxr-xr-x 1 root   root      160912 Mar 31  2016 adb*
$ sudo mv adb adb_bakup
$ ls -lt | grep adb
o/p -rwxr-xr-x 1 root   root      160912 Mar 31  2016 adb_bakup
$ export PATH="/path/to/android_sdk/platform-tools:$PATH"
$ which adb  
*o/p <your android sdk dir>/platform-tools/adb*   ---> You are all good now
Hagan answered 9/3, 2017 at 2:21 Comment(5)
I tried this from my Mac, it just tell me that I don't have permission to change the name?Selfdetermination
You need the administrator privilege to change any dir name under /usr.Hagan
I logged in as root and I still couldn't change it.Selfdetermination
great solution, I had a adb symlink to ../Cellar/..., so even if last adb version was downloaded with sdk manager, setting good path fixing the out of date problemElidiaelie
this was very useful, thanksBowlder
M
21

In my machine (Ubuntu 14.04 and Genymotion 2.5.2) the source of the problem was that, I had 2 adb files of different versions.

(Before, narrowing down this problem source, I already had Genymotion's Settings > "Use custom Android SDK tools" referring to my machine's installed Android SDK directory as advised by Aditya Kresna Permana. I also tried with killing and starting the adb server and few other solutions from around the web).

Then saw, that running adb versionfrom my Android SDK installation directory “~/Android/Sdk/platform-tools” produced - "Android Debug Bridge version 1.0.32"

But, adb version command from “/usr/bin” directory produced- “Android Debug Bridge version 1.0.31"

So just followed - http://bernaerts.dyndns.org/linux/74-ubuntu/328-ubuntu-trusty-android-adb-fastboot-qtadb to update the adb in “/usr/bin”

# adb version
Android Debug Bridge version 1.0.31
# wget -O - https://skia.googlesource.com/skia/+archive/cd048d18e0b81338c1a04b9749a00444597df394/platform_tools/android/bin/linux.tar.gz | tar -zxvf - adb
# sudo mv adb /usr/bin/adb
# sudo chmod +x /usr/bin/adb
# adb version
Android Debug Bridge version 1.0.32

And now running adb devices works perfectly as expected.

And it also solved the associated problem that, before my PhoneGap (Cordova) app was not getting integrated with the Genymotion's virtual device. Now obviously that problem solved as well.

Magner answered 25/7, 2015 at 13:26 Comment(3)
Thank you so much. Saved my time. This one works perfectly fine on ubuntu 14.04. Would like to know how did you get the wget url of adb? @MagnerMaureen
i am getting this now : bash: /usr/bin/adb: No such file or directoryCazzie
How did you check the version for adb in "~/Android/Sdk/platform-tools" ? in my case when I'm inside "~/Android/Sdk/platform-tools" and run which adb I get "/usr/bin/adb". I get a version when I type adb version but how do I know which adb is it from?Campman
S
15

I just exited HTC Sync, tried again, and it worked. Notice: Phone went black(locked), I just turned it on, and there was my application running. :)

Sentiment answered 1/7, 2011 at 22:50 Comment(1)
I had the same problem with ZTE Sync, I removed it and my devices were displayed.Simdars
M
14

System: Windows 10

My issue: Setting Genymotion to point to the custom SDK didn't have any affect. I still received the:

Couldn't start project on Android: could not install smartsocket listener: cannot bind to 127.0.0.1:5037: Only one usage of each socket address (protocol/network address/port) is normally permitted. (10048) could not read ok from ADB Server * failed to start daemon * error: cannot connect to daemon

What I discovered was there was a difference in ADB versions being used throughout the system. Here is the command I used to find them:

where /r C:\ adb.exe

This produced the results:

C:\Program Files\Expo XDE\resources\app\node_modules\xdl\binaries\windows\adb\adb.exe
C:\Program Files\Genymobile\Genymotion\tools\adb.exe
C:\Users\kyle\AppData\Local\Android\Sdk\platform-tools\adb.exe
C:\Users\kyle\AppData\Local\Android\Sdk\platform-tools\adb backup\adb.exe

Navigating to each directory and running:

adb.exe version

Allowed me to see that Expo was running ADB version:

Android Debug Bridge version 1.0.36
Revision fd9e4d07b0f5-android

While Genymotion using the custom SDK had version (c:\Users\kyle\AppData\Local\Android\Sdk\platform-tools\adb.exe):

Android Debug Bridge version 1.0.39
Revision 3db08f2c6889-android

As a test I took the adb files (adb.exe, AdbWinApi.dll, AdbWinUsbApi.dll) from

c:\Users\kyle\AppData\Local\Android\Sdk\platform-tools\adb.exe

and placed them into a backup folder. I then moved the adb files located at

c:\Program Files\Expo XDE\resources\app\node_modules\xdl\binaries\windows\adb\adb.exe

into that same location. I killed adb with:

adb kill-server

which caused a restart of the adb server automatically due to having my Genymotion device already running. I hit the "Restart" button inside of the Expo XDE and it immediately began working. Here is the log where I hit the restart button at 1:13:04 AM:

12:45:53 AM
could not install *smartsocket* listener: cannot bind to 127.0.0.1:5037: Only one usage of each socket address (protocol/network address/port) is normally permitted. (10048)
could not read ok from ADB Server
* failed to start daemon *
error: cannot connect to daemon
1:13:04 AM
Restarting project and clearing packager cache (Hold shift while clicking restart to avoid clearing cache).
1:13:11 AM
Starting React Native packager...
1:13:17 AM
Scanning 543 folders for symlinks in C:\Users\kyle\git\betalog\node_modules (49ms)
1:13:17 AM
1:13:19 AM
Couldn't adb reverse: closed
1:13:20 AM
Project opened! You can now use the "Share" or "Device" buttons to view your project.
1:13:26 AM
Couldn't adb reverse: closed
1:13:26 AM
Downloading latest version of Expo
1:13:28 AM
Installing Expo on device
1:13:33 AM
Opening on Android device
1:13:56 AM
Building JavaScript bundle: finished in 59643ms.
1:14:01 AM
Dependency graph loaded.
1:14:03 AM
Your JavaScript transform cache is empty, rebuilding (this may take a minute).

Conclusion: Genymotion and Expo may need to use the same version of adb so that Expo can properly communicate with the simulated device. Pointing Genymotion to your android SDK location as well as ensuring Expo XDE has that same version will allow correct communication between devices. I moved the Expo XDE version to the SDK location, but you might be able to go the other way (take the sdk ADB files and place them in the Expo XDE resource location).

P.S. I've been all through the stackoverflow posts related to this issue. Just so you guys know my task manager shows three instances of adb.exe running. If you kill any of them they just come back.

Hope this helps /cheers

Macropterous answered 2/8, 2017 at 8:53 Comment(3)
This resolved my first problem after a number of hours (thanks mate). The next problem was the emulated device was not authorised (adb devices) which took me less time to resolve.Memorable
I have several emulators. After running Nox, when I try to install apk on Android emulator I have an error: 'The APK failed to install. Error: Could not parse error string'. You helped me to understand that I have 3 adbs: Android Studio, Nox and MEmu. Though I haven't solve a problem, I can install apk with command line.Condemn
This solution worked for me. However, I did copy the from platform-tools to expo node_modulesConk
S
8

It would appear that the ADB daemon on the device (adbd) is disagreeing with the ADB server process on your host computer as to which version of the protocol they are speaking. Which version of the SDK are you running and what is the OS version on the device you are debugging?

What you might need to do is actually downgrade your version of the SDK tools so that the ADB daemon and process are in agreement. I thought the server process was completely backward compatible, but this could be one of those corner cases where it doesn't. Google doesn't advertise the fact that you can get their old SDK tools packages, but they can be found by looking in the archives area at http://developer.android.com.

Schwerin answered 23/2, 2011 at 15:31 Comment(4)
To which version would you recommend that I downgrade?Justus
Which device are you using and what OS version is running on it? I don't truly think it should be necessary to downgrade because that's generally not necessary, but as I was saying, this could be a corner case. SDK r10 was just released this week and r9 only a month or so ago. If the problem has been introduced recently, r7 should provide a stable basis going back to last summer. You can find these earlier versions at developer.android.com/sdk/tools-notes.html. Good luckSchwerin
OS version on device = 2.2 and SDK = 10Justus
This is not a version mismatch between adbd and adb server but rather between adb server and adb client (both running on the PC)Commuter
L
7

I experienced a similar problem where my attempts to use adb such as adb logcat provided this error output:

adb server version (40) doesn't match this client (36); killing...

This solution worked for me in 2018 on Ubuntu 18.04 from Android Studio 3.2.1 using terminal.

The commands are as follows:

adb kill-server sudo cp ~/Android/Sdk/platform-tools/adb /usr/bin/adb sudo chmod +x /usr/bin/adb adb start-server

You may need to adjust the cp command arguments based on the path to Android/ on your system.

2nd generation kudos to my source: https://mcmap.net/q/130452/-solving-quot-adb-server-version-doesn-39-t-match-this-client-quot-error-duplicate

Lifegiving answered 8/11, 2018 at 19:14 Comment(2)
I was able to do something similar without replacing /usr/bin/adb. I set an alias in bash_aliases -> alias adb='~/Android/Sdk/platform-tools/adb' . Source .bashrc and good to go.Payne
This one sounds to me like an more elegant approach: https://mcmap.net/q/128712/-adb-server-version-doesn-39-t-match-this-client - the commands before and after could be useful tho.Giavani
K
5

I simply closed the htc sync application completely and tried again. It worked as it was supposed to.

Knit answered 27/10, 2011 at 1:57 Comment(0)
C
5

I beat my head against the wall on this one. This started happening when I installed the latest version of HTC sync (3.0.5579). For some reason adb.exe was showing up multiple times in the task manager and I was getting the adb server is out of date killing errors multiple times. I found the adb.exe version in the HTC sync directory and the Android SDK platform-tools directory. I had the path setup correctly pointing at the android SDK directory and didn't see the HTC Sync path (maybe I was missing something, but I don't think so). Anyway, to fix the issue, I simply renamed the adb.exe file in the HTC Sync directory and everything worked again. This may not be the right way to go about this fix, but it worked for me.

Censor answered 6/1, 2012 at 1:2 Comment(0)
C
5

It helped me to

  • stop the HTC Sync (in system tray)

  • rename HTC's adb.exe which I found at that path:

     C:\Program Files (x86)\HTC\HTC Sync 3.0\adb.exe.
    
Cormac answered 3/5, 2012 at 9:12 Comment(0)
U
5

System: Windows 7, Android Studio.

This error occurred when I ran adb devices from Windows Commandline.

The root cause was that the adb I was running from commandline was not the same adb running from Android Studio.

Solution:

  1. First kill all running adb processes on the machine.

    taskkill /F /IM adb.exe

  2. Run your app from Android Studio.

  3. Locate the exact File Location of adb.exe either from Windows Task Manager, OR by running the command below

    wmic process where "name='adb.exe'" get ProcessID, ExecutablePath

  4. On Windows Command prompt, run where adb to locate the adb that runs from command prompt. This path would be different from the one in Step 3 above.

  5. Edit Windows system variable PATH. Delete the base path found in Step 4 from it.

  6. After you have edited PATH, you can see the current contents of this variable by typing below command in a NEW command prompt (don't use old prompt.)

    echo %PATH%

Now, run adb from command prompt. It should NOT show any "server out of date error"!

Uncanny answered 11/1, 2018 at 9:43 Comment(0)
U
4

Try this:

  1. Close the Eclipse application.

  2. adb kill-server

  3. Restart Eclipse.

Unspeakable answered 4/3, 2011 at 0:30 Comment(0)
R
4

First close All the things which use ADB. (Android Studio, Eclipse, Emulator(Bluestack as well)) and then do

adb kill-server
adb start-server

In my case I just got update of Studio.

Richmound answered 24/2, 2017 at 5:38 Comment(0)
M
3

For people developing with Android studio:

if you install adb with the command line it will probably conflict with the adb version installed by Flutter.

Analysis of issue's origin

You can check that you have this problem with 2 different versions easily:

find /home -iname "*adb"|grep -i android

And then compare the return value between adb version (located at usr/bin/adb and most likely a symbolic link for /usr/lib/android-sdk/platform-tools/adb ) with ~/Android/Sdk/platform-tools/adb version

You will get this kind of output:

$ ~/Android/Sdk/platform-tools/adb version
Android Debug Bridge version 1.0.41
Version 30.0.5-6877874
Installed as /home/{{{user}}/Android/Sdk/platform-tools/adb

$ adb version
Android Debug Bridge version 1.0.39
Version 1:8.1.0+r23-5~18.04
Installed as /usr/lib/android-sdk/platform-tools/adb

My advice is hence the following: DO NOT RELY ON sudo apt-get install adb

Solution

1/ You first want to remove adb installed through the command line: (this is way cleaner than sudo rm usr/bin/adb

sudo apt-get remove adb

2/ Then create symbolic link from the sdk to usr/bin (top answer already provided):

sudo ln -s ~/Android/Sdk/platform-tools/adb  /usr/bin/adb

Now you can use the different command lines adb devices, adb start-server, adb kill-server

Mcgee answered 12/1, 2021 at 18:3 Comment(2)
Great solution, thank you. A much better way to use it than the default one.Dialogism
This is a great solution, but I didn't want to overwrite the distro install of adb, so I temporarily renamed /usr/bin/adb to /usr/bin/adb.xxx, and then used ~/Android/Sdk/platform-tools/adb and was able to access the device with no errors. Afterwards, I restored the original distro /usr/bin/adb name. This is an alternative if you are not ready to overwrite your distro install of adb.Chappell
P
2

Okay, there is another instance of adb.exe distributed with "Lenovo Photo Companion". A friend of mine has a Lenovo Yoga notebook and had this software installed which includeded another adb.exe

Deinstalling it solved the problem.

Plantar answered 7/1, 2015 at 9:52 Comment(0)
G
2

Unfortunately I do not have enough reputation to comment yet. But the response marked as an answer sent me in the right direction.

I did not see anything in my path related to HTC Sync Manager, though I had it installed. I'm not working with my HTC device at the moment, and only had the sync manager installed to help with driver issues. Once uninstalling the HTC sync manager this issue went away for me.

Hope this helps someone else.

Glaucous answered 13/2, 2015 at 15:1 Comment(0)
E
2

OS: Ubuntu

There are more than 1 adb are running. Check the current adb:

    which adb
    Expected Output : ANDROID_SDK/platform-tools/adb

Normally the result will be:

    /usr/bin/adb

Delete this older version by:

    cd /urs/bin
    sudo rm adb
Erdmann answered 12/4, 2018 at 18:18 Comment(0)
L
1

Did you try using the SDK version 8. Since the device is in 2.2, and your SDK is at 10, there might be conflict.

Best of luck with your downgrading efforts!

Labial answered 28/2, 2011 at 12:45 Comment(0)
P
1

If the device you're trying to interact with is a physical phone connected via USB, you can unplug it and plug it back and and it should work. Sometimes it just gets out of sync I think.

Photoplay answered 4/3, 2011 at 3:29 Comment(0)
P
1

I had this issue on one of my development machines (all run windows 7 x64) while all other machines' adb work normally. The reason I ran into this issue is I have an old version of adb.exe reside in %android-sdk%\tools while newer Android SDKs have adb.exe under %android-sdk%\platform-tools

remove the older adb.exe from %android-sdk%\tools and add %android-sdk%\platform-tools to %PATH% solves this issue

or more generally, hunt down any adb executable in your path that are out of date, just use the latest one provided with Android SDK

Polyhymnia answered 18/4, 2012 at 4:17 Comment(0)
F
1

I went through all the answers on SO and it didn't work for me. When I killed the adb.exe process from Task Manager, it kept reopening it and the reason was that Droid Explorer was working in the background.

Killing the DE process via Task Manager and then killing adb.exe (and running it again from the console through 'adb start-server' worked for me.

This can be useful for many people who have rooted their devices.

Folkestone answered 23/6, 2012 at 20:32 Comment(1)
This was the solution for me. Make sure to End process tree in Task Manager for the Droid Explorer service.Annalee
S
1

In my case, the problem was caused by Virtuous Ten Studio, which has the adb.exe in External/ADB directory.

Go there and run .\adb.exe kill-server and you'll be good.

Spotter answered 9/7, 2017 at 21:42 Comment(0)
G
1

This was caused in my case by running Visual Studio with an Android Xamarin project on the same machine as Android Studio - each IDE had a different adb server version running. I closed Visual Studio and the error went away.

Gingery answered 12/11, 2018 at 8:10 Comment(0)
B
1

I have seen the following error twice in the past week or so:

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

I fixed it by rebooting my PC every time. I do not know how to explain it.

I tried killing and starting adb via command line multiple timea, restarting Android Studio multiple times to no avail. Task Manager does not show adb.exe.

I am running Android Studio 3.4 on Windows 10 (V1809, Build:17763.503)

Edit (2019-05-30): When this happened for the 3rd time, I closed all applications, then restarted Android Studio, and the problem was solved. It seems that another application causes this. I will report back once I find the culprit.

Edit (2019-05-30): I have finally found the culprit - Visual Studio paired with a Macbook Pro for building and debugging an iOS app. Once VS is closed or the pairding is disabled, adb becomes normal.

Brachio answered 30/5, 2019 at 1:14 Comment(1)
I just had to reboot.Parenthood
M
1

I did the following I had the same mis match error in mac OS, I was trying to install an apk.

  1. mv /usr/local/bin/adb /usr/local/bin/old_adb
  2. Reinstall platform tools brew cask install android-platform-tools or brew reinstall --cask android-platform-tools
  3. adb kill-server
  4. adb start-server

If you are trying to install apk, reinstall and check.

Magulac answered 27/1, 2021 at 18:54 Comment(0)
M
0

As mentioned above, the problem comes due to a conflicting version of adb.exe shipped with HTC Sync. Removing it from PATH won't help, as htcUPCTLoader.exe that constantly runs in the background will still re-launch the wrong ADB version.

One solution would be to completely remove adb.exe from the HTC Sync folder, however this would break HTC Sync.

I've just coded a simple tool that replaces the old adb.exe with a stub that invokes the latest adb.exe from the SDK directory eliminating the conflicts (e.g. version 1.0.25 coming with HTC Sync and 1.0.29 with Android SDK).

ADB Fixer tool

The tool can be downloaded from http://visualgdb.com/adbfix

Midden answered 10/7, 2012 at 17:29 Comment(0)
K
0

I also had this problem today, turns out I disabled my network drivers because I had WIFI/LAN issues. re-enabling fixed the issue

Kazoo answered 7/1, 2015 at 10:37 Comment(0)
F
0

installing sdk updates (including platform tools) fixed for me!

Fahy answered 27/6, 2018 at 9:57 Comment(0)
A
0

Since adb server is out of date. killing is now a dupe of this, copy-paste of a solution for Debian-based systems:

It might be that you installed the adb package in addition to the SDK's. In that case, a

sudo apt purge adb

might solve the problem.

Amos answered 28/6, 2018 at 9:43 Comment(0)
H
0

To actually explain what happens:

The ADB executable has two components

  • the server, which communicates with the device
  • and the client, the command line, which communicates with the server.

When you start ADB for the first time you may notice a message like "starting ADB server". If you updated ADB after that, the newer executable needs to kill the obsolete server and start a new one with matching version.

This can also happen when you have multiple versions of ADB present on your development machine (Genymotion, Android SDK, phone OEM companion apps, various standalone scripts).

This does not concern the ADB installed on your phone/emulator.

The obvious (not necessarily easy) solution is to make sure you use the same version of ADB everywhere.

Heterosexual answered 19/8, 2018 at 19:48 Comment(0)
W
0

Question Iam coming from was marked as [duplicate] to this question but I havent seen the answer i needed here.

adb server version (41) doesn't match this client (36); killing... ADB server didn't ACK.

Look at this: https://mcmap.net/q/130453/-adb-server-version-36-doesn-39-t-match-this-client-39-killing-duplicate

Warrantee answered 16/7, 2019 at 9:26 Comment(0)
G
0

If you have multiple adb's running stoping them will do like if you are using vs code for flutter development closing vs code will help.

Gladygladys answered 27/7, 2019 at 8:23 Comment(0)
D
0

Systems: Mac OS

In my case, I did not have two adb servers running so none of the solutions helped.

I have updated Android Studio to the latest, but I also had an old version of adb installed using brew cask. And while I updated my Android Studio to the latest, the adb was still pointing to the brew installed older version.

So after updating the brew cask version, using:

brew cask install android-platform-tools

And making sure that the adb itself was pointing to the new version, the errors went away.

Dulcet answered 19/9, 2019 at 1:31 Comment(0)
M
0

Solved it very conveniently by overwriting the binary file located in /usr/bin/adb with the one from Android directory (~/Android/Sdk/platform-tools/adb):

sudo cp ~/Android/Sdk/platform-tools/adb /usr/bin/adb

You can check the exact repositories with:

whereis adb
Mcgee answered 21/5, 2021 at 21:29 Comment(0)
H
-1

in my case I updated the SDK (on the settings in genymotion), or then the genymotion update

Hexad answered 1/7, 2019 at 2:47 Comment(0)
C
-2

You need to make sure that your project is set to target the AVD that you want to launch.

Right click (ctrl-click MAC) on the project folder in Eclipse. Then click on Properties. In the window that shows up, click on "Android" and then click on the build target you want to launch. Hope that helps.

Colous answered 4/3, 2011 at 5:46 Comment(0)
M
-9

I was getting this same error when I started Android Studio. Uninstall the mobogenie software. It worked. TRY THIS SOLUTION, IT HELPED ME. ADB ERROR

Mook answered 24/10, 2015 at 20:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.