166

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
Alex P.
  • 30,437
  • 17
  • 118
  • 169
Arunabh Das
  • 13,212
  • 21
  • 86
  • 109
  • For me, helped exitting Helium desktop app, which have own adb version. :) – Velda Oct 05 '16 at 10:58
  • In my case it was Genymotion, there's a configuration to use their own version or you can set your own. – Crysfel Feb 22 '17 at 04:59
  • http://stackoverflow.com/a/39421515/1778421 – Alex P. Apr 29 '17 at 12:16
  • 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. – Paschalis May 03 '17 at 15:48
  • 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 https://android.stackexchange.com/questions/232859/adb-server-version-40-doesnt-match-this-client-41-not-using-genymotion (I didn't find a soultion in the other Q/A) – Cadoiz Jan 15 '21 at 05:51
  • Also, if you're absolutely stuck like I was, try a different host device or new installation instead of giving up! → https://android.stackexchange.com/a/234460/340401 – Cadoiz Mar 08 '21 at 09:19

41 Answers41

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.

Aditya Kresna Permana
  • 11,869
  • 8
  • 42
  • 48
  • 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. – TacoEater Dec 24 '14 at 20:19
  • 1
    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. – bdutta74 Jan 19 '15 at 12:26
  • Gotta love Genymotion as stock emulators consume too much resources as they are constantly heating up my beatup laptop running on Ubuntu. – thethakuri May 24 '15 at 16:03
  • 1
    I do not have **genymotion** installed in my system. How do I fix this? – arka.b Sep 04 '15 at 10:18
  • This is great, thank you! Just to add quit GenyMotion (the device launcher and the any open simulators) before calling the adb commands – Meanman Mar 14 '16 at 11:04
  • 7
    Any genymotion emulator must be closed before running commands above. – Robert Mar 20 '16 at 15:33
  • Thank you! :) I used Gennymotion emulator. "adb devices" command worked again. :p – Tam Dao Apr 09 '16 at 08:31
  • @Robert 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: – Gaurav Lad Jun 27 '16 at 16:27
  • @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 genymotion – Aditya Kresna Permana Jul 02 '16 at 19:05
  • @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 ? – Thidasa Pankaja May 07 '18 at 01:27
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.

Vaiden
  • 15,728
  • 7
  • 61
  • 91
Arunabh Das
  • 13,212
  • 21
  • 86
  • 109
  • 1
    This problem is in my mac os-x apple device. – Ritesh Kumar Singh Mar 12 '15 at 05:35
  • 4
    HTC Sync was the issue. It continuously runs in the background, causing conflicts with adb.exe – rharvey Aug 12 '15 at 08:47
  • LG AirBridge caused the problem for me - uninstalling that and then running `adb start-server` worked. – jamsandwich Dec 12 '16 at 22:56
  • 1
    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. – tom_mai78101 Jan 20 '19 at 03:13
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.

Andy
  • 17,423
  • 9
  • 52
  • 69
  • 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. – jay_t55 Jan 06 '15 at 11:57
  • 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..." – mr5 Oct 22 '18 at 06:01
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
CJBS
  • 15,147
  • 6
  • 86
  • 135
  • 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. – Gwened Feb 07 '16 at 16:49
25

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

Ian Samz
  • 1,743
  • 20
  • 20
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
Akh
  • 5,961
  • 14
  • 53
  • 82
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.

Rohan_Paul
  • 1,504
  • 3
  • 29
  • 36
  • 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? @Rohan_Paul – Akbarsha Feb 29 '16 at 06:54
  • i am getting this now : bash: /usr/bin/adb: No such file or directory – Tushar Saha Jul 13 '18 at 09:05
  • 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? – Ali Akber Dec 24 '21 at 07:14
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. :)

Nemi
  • 1,012
  • 10
  • 19
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

Kyle s
  • 484
  • 5
  • 14
  • 1
    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. – Jonathan Oct 29 '18 at 21:36
  • 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 `adb`s: Android Studio, Nox and MEmu. Though I haven't solve a problem, I can install apk with command line. – CoolMind Nov 03 '20 at 15:09
  • This solution worked for me. However, I did copy the from platform-tools to expo node_modules – Abhishek E H Dec 06 '20 at 05:54
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.

Eric Cloninger
  • 2,260
  • 2
  • 21
  • 26
  • 1
    To which version would you recommend that I downgrade? – Arunabh Das Feb 23 '11 at 22:06
  • 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 http://developer.android.com/sdk/tools-notes.html. Good luck – Eric Cloninger Feb 23 '11 at 22:31
  • OS version on device = 2.2 and SDK = 10 – Arunabh Das Feb 23 '11 at 22:56
  • This is not a version mismatch between `adbd` and `adb server` but rather between `adb server` and `adb client` (both running on the PC) – Alex P. Dec 31 '16 at 21:23
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://stackoverflow.com/a/40991118/7015599

Sarkis
  • 303
  • 2
  • 12
  • 1
    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. – James Dec 27 '18 at 17:46
  • This one sounds to me like an more elegant approach: https://stackoverflow.com/a/56859299/4575793 - the commands before and after could be useful tho. – Cadoiz Jan 07 '21 at 04:09
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.
    
piotrek1543
  • 19,130
  • 7
  • 81
  • 94
Maxim
  • 51
  • 1
  • 1
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"!

user13107
  • 3,239
  • 4
  • 34
  • 54
5

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

Harsha Kanth
  • 51
  • 1
  • 1
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.

Skylert
  • 51
  • 1
  • 1
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.

jeet.chanchawat
  • 5,842
  • 5
  • 38
  • 59
4

Try this:

  1. Close the Eclipse application.

  2. adb kill-server

  3. Restart Eclipse.

Adrian Toman
  • 11,316
  • 5
  • 48
  • 62
dcanh121
  • 4,665
  • 11
  • 37
  • 84
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

Antonin GAVREL
  • 9,682
  • 8
  • 54
  • 81
  • Great solution, thank you. A much better way to use it than the default one. – Sabo Feb 02 '21 at 17:15
  • 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. – Ken H Dec 28 '21 at 22:23
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.

Wolkenjaeger
  • 908
  • 1
  • 10
  • 21
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.

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
Zed
  • 59
  • 4
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

Yenchi
  • 2,076
  • 24
  • 30
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.

syntagma
  • 23,346
  • 16
  • 78
  • 134
  • This was the solution for me. Make sure to `End process tree` in Task Manager for the Droid Explorer service. – Jason Mar 05 '13 at 09:42
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.

Tomáš Zato
  • 50,171
  • 52
  • 268
  • 778
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!

halfer
  • 19,824
  • 17
  • 99
  • 186
amiekuser
  • 1,630
  • 1
  • 19
  • 31
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.

Nate Radebaugh
  • 1,044
  • 2
  • 20
  • 29
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.

dodgy_coder
  • 12,407
  • 10
  • 54
  • 67
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.

Hong
  • 17,643
  • 21
  • 81
  • 142
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.

CoderTest
  • 35
  • 1
  • 6
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

Community
  • 1
  • 1
Ivan Shcherbakov
  • 2,063
  • 14
  • 23
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

bvanvelsen - ACA Group
  • 1,741
  • 1
  • 14
  • 25
0

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

hmac
  • 267
  • 3
  • 9
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.

serv-inc
  • 35,772
  • 9
  • 166
  • 188
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.

Eugen Pechanec
  • 37,669
  • 7
  • 103
  • 124
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://stackoverflow.com/a/47797366/8187578

Kebab Krabby
  • 1,574
  • 13
  • 21
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.

el2e10
  • 1,518
  • 22
  • 22
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.

Edward Tan
  • 934
  • 9
  • 17
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
Antonin GAVREL
  • 9,682
  • 8
  • 54
  • 81
-1

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

malik kurosaki
  • 1,747
  • 15
  • 9
-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.

Wrenbjor
  • 157
  • 5
-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