If you've ever used the Android Debug Bridge (ADB), you know that it's such a hassle to set up (if you don't happen to be a developer who installed Android Studio already anyway). But with new web tools like the WebUSB API, there's no longer a need to rely on local software to fulfill the most basic ADB needs. That's where WebADB comes in, a free and open-source web service spotted by XDA Developers that allows you to debug Android devices from any supported browser.

The tool is still in beta and sometimes a little wonky, but almost everything works as expected. In contrast to the command line-based ADB most people are used to, the web tool comes with a graphical interface that makes a few things easier for the laypeople, such as installing APKs, using the screen controlling tool Scrcpy, or taking screenshots.

Hangzhou-based developer Simon Chan is actively working on improving it on Github, so we can expect it to get even better in the future. Since WebADB is open source, you can also add your own pull requests and bug reports if you want to help out.

The following features are currently supported:

  • APK installation
  • Interactive shell
  • Screenshots
  • Scrcpy - Control your device from your browser
  • Device Information
  • File Manager
  • Enabling ADB over Wi-Fi

Keep in mind that WebADB is not a local tool like regular ADB, but a website that you basically grant full control over your phone, potentially giving bad actors a chance to push malware on it. Since WebADB is an open-source tool that anyone can check out, it's unlikely that it's abusing its power, but the chance is never zero. Proceed at your own risk, and check out the source code if you're a well-versed coder. You might even want to build your own fork to be extra safe.

Prerequisites

To get started with ADB, you'll first have to activate the developer options on your phone if you haven't already. Go to your system settings, look for your device's build number and tap it seven times (it's usually in the About phone section — the exact location varies by manufacturer). You should then see a toast telling you that you're now a developer, and you'll find a new developer options entry in settings. Scroll down to the Debugging section in there and toggle on USB debugging.

At the moment, WebADB only properly works with Chromium-based browsers such as Chrome or Microsoft Edge, so make sure you follow the next steps in a supported application.

Connecting your phone to WebADB

When you connect your phone to your computer, make sure you're in the USB file transfer mode and allow your PC to access your files. Now it's time to go to webadb.com. On it, you'll find a list of available devices in the top left corner, but you'll first need to add your phone to make it appear there — that's to avoid that any website can access devices plugged into your computer. Tap the Add device button and select your handset. Then choose it from the drop-down list and click Connect. On your phone, you'll need to allow your computer to establish a debugging connection — WebADB will tell you as much.

If you're a Windows user, you'll also have to enable the new USB backend under chrome://flags/#new-usb-backend and restart your browser (copy and paste the URL into your address bar).

Using WebADB

Once your phone is connected, the items in the left sidebar will come in handy. Device Info will tell you about your phone, ADB over Wi-Fi can be used to activate the wireless version of the debug bridge (WebADB doesn't support ADB over Wi-Fi yet), and then there are the really interesting options: Interactive Shell, File Manager, Install APK, Screen Capture, and Scrcpy.

The Interactive Shell will open a command line interface that you can use for many shell commands (though some haven't been implemented yet). Here's a full list — most of the commands starting with adb shell will work, but remember that you don't have to type out that part in WebADB. Be careful if you've never used a tool like this before. You could potentially wreak havoc if you send the wrong commands.

The File Manager might be more interesting for regular users. You can explore what's on your phone and view image previews right on the website, but you can't really interact with any of the files (yet). You're limited to adding new data to your phone and downloading and deleting content on your handset. Copying or moving files isn't supported. It's still a neat and fast solution if you just need to move data from your phone to your computer or vice versa.

The Install APK option is as self-explanatory as it can get. Click the open button and select an APK from a source like APK Mirror to install on your phone. A bar will inform you about the uploading and installing progress. Right now, you can only install one APK per session, but I'd hope that this limitation is something the developer will tackle soon.

Screen Capture is a tool you can use to take screenshots in any app that allows them. You won't see a preview of the screenshot before you hit the Capture button, so you'll have to look at your phone to see what you're taking an image of. To save it to your computer, right-click it and select Save image as... This only works for apps that allow you to take screenshots. Otherwise, you'll get a cryptic "The EventQueue has already ended" error message.

When you want to take a screenshot of an app that forbids it, such as your banking app or incognito tabs (a limitation that's about to be lifted), you would theoretically use Scrcpy. We've recommended it before. Unfortunately, the version WebADB has implemented is pretty useless right now. You can start and stop a recording and view it in WebADB, but there's currently no way to save the video or extract a frame. We've tried running Scrcpy in the interactive WebADB shell, but the command isn't implemented there.

Scrcpy usually also allows you to control your phone from your computer, but the latency of more than a second is just too jarring, so it's not a viable option with WebADB's implementation.


WebADB is already incredibly useful for those of us who don't want to deal with installing ADB on their computers for shell commands, but there are many limitations. The file explorer is as barebones as it can be, you can only install one APK per session, and you can't download Scrcpy videos, making the ability to record them in the first place pretty useless.

But there's a ton of potential, and we have to remember that WebADB is clearly marked as a Beta. Once it reaches stable, it might be the best option for anyone who only wants to use ADB to take screenshots in apps that block them.

Right now, the tool is already great if you just want to push some shell commands to your phone without going through the hassle of setting up ADB — which is great if you quickly want to enable some display tweaks on your Pixel 4 or modify your navigation bar (on Android 10 or lower).

Source: WebADB, Github, Chensi.moe

Via: XDA Developers

Thanks: Nick