Whenever I try to run adb devices:
$ adb devices
* daemon not running. starting it now *
* daemon started su
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