DEV Community

Recca Tsai
Recca Tsai

Posted on • Originally published at recca0120.github.io

Fix adb Server and Client Version Mismatch on Mac

Originally published at recca0120.github.io

The Problem

After updating the Android SDK, running adb devices threw:

adb server version (41) doesn't match this client (40)
Enter fullscreen mode Exit fullscreen mode

It turned out that I had previously installed android-platform-tools via Homebrew on my Mac, resulting in two different versions of adb on the system. The server and client were picking up different versions.

The Fix

First, remove the Homebrew-installed copy:

brew uninstall --cask android-platform-tools
Enter fullscreen mode Exit fullscreen mode

Then add the Android SDK path to ~/.bashrc so the system uses a single adb:

export ANDROID_HOME="/Users/recca0120/Library/Android/sdk"
export PATH="$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$PATH"
Enter fullscreen mode Exit fullscreen mode

Finally, run source ~/.bashrc to apply the changes, then adb devices should work normally.

Top comments (0)