Piping ADB

Source code is located in https://github.com/nwtgck/piping-adb-web.

Usage

First, open adbd 5555 port on an Android device using adb tcpip 5555 or su 0 setprop service.adb.tcp.port 5555; su 0 stop adbd; su 0 start adbd

Second, the device starts a tunneling over Piping Server in some way, equivalent to the following command:

curl -sSN https://ppng.io/aaa | nc localhost 5555 | curl -sSNT - https://ppng.io/bbb

Finally, open the following URL on a Chromium-based browser.

https://piping-adb.nwtgck.org/#?auto_connect&server=https://ppng.io&cs_path=aaa&sc_path=bbb

Acknowledgements

This project is highly based on ya-webadb. Thanks to the original author!

Demo

Piping ADB scrcpy

Piping ADB shell

Piping ADB file manager

The following document is from the original README.


It started because I want to try the WebUSB API, and because I have an Android phone. It's not production-ready, and I don't recommend normal users to try it. If you have any questions or suggestions, please file an issue at here.

It was called "ya-webadb" (Yet Another WebADB), because there have already been several similar projects, for example:

However, they are all pretty simple and not maintained, so I decided to make my own.

Security concerns

Accessing USB devices (especially your phone) directly from a web page can be very dangerous. Firefox developers even refused to implement the WebUSB standard because they considered it to be harmful.

However, I'm pretty confident about this demo, and here is a few reasons:

  1. Unlike native apps, web apps can't access your devices silently. In addition to the connection verification popup that comes with ADB, browsers ask users for permission and web apps can only access the device you choose.
  2. All source code of this project is open sourced on GitHub. You can review it yourself (or find someone you trust and knows coding to review it).
  3. This site is built and deployed by GitHub Actions to ensure that what you see is exactly the same as the source code.

Compatibility

Currently, only Chromium-based browsers (Chrome, Microsoft Edge, Opera) support the WebUSB API. As mentioned before, it's unlikely for Firefox to implement it.

FAQ

Got "Unable to claim interface" error

One USB device can only be accessed by one application at a time. Please make sure:

  1. Official ADB server is not running (stop it by adb kill-server).
  2. No other Android management tools are running.
  3. No other WebADB tabs have already connected to your device.

Can I connect my device wirelessly (ADB over WiFi)?

Extra software is required to bridge the connection. See this discussion.