How does WebADB work (part 0) - Overview

With the appearance of WebUSB API, which allows JavaScript running in browsers to communicate with devices over USB, an interesting idea came into my mind: Can I implement the Android Debug Bridge (ADB) protocol in JavaScript?

Turns out someone has already tried that, but this one isn’t that well-featured (It even doesn’t support token authentication). So I thought it was still worth a shot.

I have already completed some features, during that I have so many details I want to record and share. In this series of blog posts, I want to achieve:

  1. Document the ADB protocol in detail. Current documentation of ADB itself is pretty outdated. ADB had added many iterations to exist features without documentation.
  2. Share reasons about my architecture decisions.
  3. Record the process of me implement each feature.

You can check the source code at
I have also made an online demo you can try at If you have any problems, file an issue at