GitHub

ADB WiFi Connect Tool

This tool simplifies the process of connecting to Android devices over WiFi using ADB (Android Debug Bridge) without requiring a USB connection.

Features

  • Automatic discovery of Android devices advertising ADB over WiFi
  • Seamless pairing and connection using the QR code
  • Support for both pairing and connection modes
  • Displays discovered devices with their network information

Prerequisites

  • Deno runtime
  • An Android device with Developer Options enabled
  • Wireless Debugging enabled on your Android device

Usage

  1. Run the script:
deno -NS --unstable-net --allow-run=adb main.ts

You can also run the script remotly with no setup

deno -NS --unstable-net --allow-run=adb https://raw.githubusercontent.com/sigmaSd/adb-wifi/refs/heads/master/main.ts
  1. The script will:

    • Generate a random name and password for the connection
    • Display a QR code that can be scanned from your Android device
    • Begin searching for Android devices advertising ADB over WiFi
  2. On your Android device:

    • Go to Settings → Developer options → Wireless debugging
    • Tap "Pair device with QR code"
    • Scan the QR code displayed in your terminal
  3. The script will automatically detect your device and attempt to pair and connect to it.

  4. Afer pairing, you might need to disable then enable wifi debugging on the phone, so it sends the connect message.

Note: discovering mDns messages can take 10s of seconds.

How It Works

The tool uses mDNS (multicast DNS) to discover Android devices that are advertising ADB over WiFi services on your local network. It listens for two service types:

  • adb-tls-pairing - For initial pairing with a device
  • adb-tls-connect - For connecting to an already paired device

When a device is discovered, the tool automatically attempts to pair with it using the generated password, and then establish a connection.

Permissions

This script requires the following permissions:

  • --allow-net: For network discovery and ADB connections
  • --allow-run: To execute ADB commands
  • --allow-sys: To get the hostname and the network interfaces

License

MIT

Read the original on github.com ↗