I'm trying to connect adb to my Android device in the Windows 10 Ubuntu shell, but it doesn't seem to be working:

Waiting for Device in Ubuntu Bash Shell

adb does work normally on Windows, so it's not a problem with the phone or the connection. Do I have to do something like mount the port in the Ubuntu shell? How? (The goal is to pass logcat to grep, which would obviously work better in Ubuntu.)

4 Answers 4


There is a tricky way to make it work even with current limitations. You need to start adb server from cmd:

adb kill-server //if it is already running under bash shell
adb start-server

Then you can call adb from bash shell, it will use existing server and as result will be able to list connected devices.

adb devices

Note: Because the environment is loading paths from the Windows PATH variable, you may need to run with the .exe extension as well (or alias adb to adb.exe to keep commands the same).

adb.exe devices
  • does this depend on being able to run adb in windows by typing adb directly and not a full path?
    – Menasheh
    Commented Nov 7, 2016 at 4:56
  • 1
    This doesn't work. I get the following error when attempting to start from cmd and then list from bash.. adb server is out of date. killing... * daemon started successfully * So it looks like from the bash side it's killing and restarting the server.
    – Byron
    Commented Aug 26, 2017 at 19:52
  • I got this working in Windows 10. I have only adb on Windows installed and adb package on Ubuntu subsystem removed. Start server in Windows, enter bash, go to your adb folder (bash didn't recognize my Windows PATH). adb.exe shell didn't work but adb.exe devices and adb.exe pull works. This is enough for me to use adb with bash scripts.
    – nikkou
    Commented Aug 30, 2017 at 11:35
  • The trick appears to be that the TCP protocol version of the server and client must match. I found that the major version number of the platform-tools package is equal to 8 less than the protocol version number. On ubuntu, adb 7.0.0+r33-2 complained that it needed protocol version 36, so I downloaded dl.google.com/android/repository/… and it worked.
    – fuzzyTew
    Commented Mar 5, 2019 at 12:41
  • (sorry, 12 less than the protocol version: as I edited in the answer, I needed platform-tools 24.0.4 for adb 7.0.0+r33-2 on stable ubuntu today)
    – fuzzyTew
    Commented Mar 5, 2019 at 12:52

The bash shell under Windows does not have functions to connect to USB devices. So ADB is not going to work until someone adds that.

Here is the proposal for adding USB support.

  • What does that even mean? Someone = Microsoft or Canonical or both? How do you know this?
    – Menasheh
    Commented Sep 18, 2016 at 19:03
  • This is actually the support thread for for COM/serial-USB support: wpdev.uservoice.com/forums/…. The one you listed is for drives only.
    – Afzal
    Commented Apr 19, 2017 at 7:09
  • @Menasheh Microsoft needs to implement this. They wrote the backend that offers devices from Windows.
    – fuzzyTew
    Commented Mar 5, 2019 at 22:10

Adding onto Paul's other answer, you can access the Windows adb server from Ubuntu to resolve this, but it works if and only if the two adb binaries use the same TCP protocol version. For example, adb 7.0.0+r33-2 in Bionic will work with platform-tools 24.0.4 on Windows.

If you have a different version, my first step was just running adb in Windows as he suggests:

> adb kill-server //if it is already running under bash shell
> adb start-server

And then in Ubuntu:

$ adb devices

If the binary protocol versions mismatch, then after running adb in Ubuntu an error is output that gives enough information to get the right binary:

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

In this example, the server is using protocol version 40, and Ubuntu's package is using version 36. So, one approach is to get a version of adb on Windows that is 4 major releases earlier than the one you have. You can review the platform-tools release notes to find the latest minor version of the needed major version. At the time of this writing, the major version number of platform-tools is 12 lower than the protocol version number of adb, so for protocol version 36 as in this example, we would want platform-tools version 24.0.4 (which is 4 less than 28.0.1, which had protocol version 40). This version number can be used to hand-craft a download url for platform-tools of the needed version.

                         change to correct version here----^

Download and unpack this archive, and rerun adb from cmd:

> adb kill-server
> adb start-server

Now adb will work from Ubuntu.

  1. sudo vim /etc/profile, then add the below lines(fastboot is optionally) and save, please replace the adb and fastboot paths with your actual paths, note the translation of folders with spaces in the path.

    export PATH=$PATH:/mnt/c/Program\ Files/platform-tools_r30.0.3-windows/platform-tools/

    alias adb='/mnt/c/Program\ Files/platform-tools_r30.0.3-windows/platform-tools/adb.exe'

    alias fastboot='/mnt/c/Program\ Files/platform-tools_r30.0.3-windows/platform-tools/fastboot.exe'

  2. source /etc/profile

  3. See what happened.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .