Skip to main content
Version: 2.0.0

Quick start

Welcome

Welcome to Tango ADB's developer documentation! 🎉

Tango is a TypeScript re-implementation of ADB (Android Debug Bridge) client for Web browsers, Node.js, and Electron.

If you are looking for our Tango Web application where you can control your Android devices, that's at https://app.tangoapp.dev.

Traditional Programmatic ADB Usage

Most programs that use ADB do so by spawning the Google ADB executable with specific arguments. This approach involves:

  1. Installing the Google ADB executable on the system.
  2. Running the executable with command-line arguments to perform desired actions, such as connecting to a device, pushing files, or executing shell commands.

For example, to pull some photo files from a device using the traditional approach, a program might execute the following command:

adb pull /sdcard/DCIM/Camera .

Server Transport

Tango ADB takes a different approach by directly creating sockets to the Google ADB server. While still requiring the Google ADB executable to be present and running, this approach allows Tango ADB to:

  1. Interact with the ADB server in a more efficient and robust way.
  2. Provide a more programmatic and flexible way of using ADB.
WebNode.jsElectron
Requires a native "bridge" program

Because Google ADB uses TCP sockets, it's not directly supported on Web platform. To use server transport on Web platform, a native "bridge" program is required to convert TCP sockets to WebSocket.

Daemon Transport

Tango ADB also offers a new transport mode that directly connects to the ADB daemon running on Android devices, eliminating the need for the Google ADB executable.

The daemon transport mode offers the following distinct benefits:

  • No dependency on Google ADB: By connecting directly to the ADB daemon, Tango ADB no longer requires the Google ADB executable to be installed or running.
  • USB connections in modern Web browsers: Using the WebUSB API, Tango ADB can establish USB connections to Android devices directly from modern Web browsers, enabling a seamless and plugin-free experience.
ConnectionWebNode.jsElectron
USB
ADB over Wi-FiRequires a native "bridge" program

Installation

Tango is split into multiple packages to support different runtime environments. First, install the two core packages:

  1. @yume-chan/adb: The platform-independent ADB client implementation
  2. @yume-chan/stream-extra: Type definitions and utilities for Web Streams API.
npm i @yume-chan/adb @yume-chan/stream-extra
note

The public API is not stable. Check migration page for changes.

If you have any questions, feel free to open a discussion on GitHub ❤️

First Step

Tango provides an Adb class, which contains high-level APIs for ADB commands, and also allows custom commands to be added.

The end goal is to create an Adb instance, but first, an AdbTransport object is required.

The AdbTransport interface defines how to communicate with ADB Daemons (basically, your devices). ADB Daemon is the program on Android devices (when USB Debugging or Wireless Debugging options are enabled) that handles incoming ADB connections and commands.

Tango provides two built-in transports: Daemon Transport and Server Transport, and also accepts custom transport implementations.

Answer several questions to determine which transport you need:

1. Where does you app run?