Quick start
Welcome to Tango ADB's developer documentation! 🎉
Tango includes a TypeScript re-implementation of Scrcpy client for Web browsers and Node.js.
If you are looking for the Scrcpy application where you can mirror and control your Android devices, here is the official repository.
Scrcpy is an open-source tool to mirror Android screen to desktop, and control it from desktop. It has two parts:
- A client written in C: Uses SDL for cross-platform display and input, and FFmpeg for video decoding. It spawns Google ADB client to set up a reverse tunnel, start server on device, and connect to it.
- A server written in Java: Runs on Android devices (but it's not an Android app), uses Android system APIs to capture screen/audio, send them to client, and inject input events. The server is started by client using ADB, thus having much more privileges than regular apps.
Tango's Scrcpy client implementation is fully compatible with the original Scrcpy server, so latest features and bug fixes are available immediately. It doesn't provide any UI components, so you need to create your own UI.
Standalone Usage​
The core package @yume-chan/scrcpy
provides low-level APIs to serialize and deserialize Scrcpy messages.
It only handles data. It's up to the user to send and receive those data with Scrcpy server.
It doesn't use any Web or Node.js APIs, so it can be used in any JavaScript environment.
- npm
- Yarn
- pnpm
npm install @yume-chan/scrcpy
yarn add @yume-chan/scrcpy
pnpm add @yume-chan/scrcpy
It can be used standalone if you can communicate with Scrcpy server using other means.
Use with Tango​
The @yume-chan/adb-scrcpy
package provides a complete Scrcpy client. It can push the server file to device, start the server, setup and establish the connection, and communicate with the server.
It uses @yume-chan/adb
package to control the device, and @yume-chan/scrcpy
package to parse and serialize Scrcpy messages.
However, it doesn't provide any UI components. You need to create your own UI to display the screen and handle input events.
It also doesn't use any Web or Node.js APIs.
- npm
- Yarn
- pnpm
npm install @yume-chan/scrcpy @yume-chan/adb-scrcpy
yarn add @yume-chan/scrcpy @yume-chan/adb-scrcpy
pnpm add @yume-chan/scrcpy @yume-chan/adb-scrcpy
Overview​
Here are the steps to use Scrcpy:
- Prepare server: Include prebuilt Scrcpy server binary in your project.
- Push server to device: Send the server binary to device.
- Prepare reverse tunnel (when using reverse tunnel): Reverse tunnels need to be setup before starting the server.
- Start server on device.
- Connect to server: Create connections to transmit video, audio and control messages.
- Decode and render video, record video to files, decode and play audio, control the device.