From 74c1bbbac14efa1c58aacbccc4bf1a10a5ccd5ea Mon Sep 17 00:00:00 2001 From: Andika Rusli <60590034+kakrusliandika@users.noreply.github.com> Date: Tue, 14 Oct 2025 00:35:15 +0700 Subject: [PATCH 1/3] Create wifi_adb_toolbox.md --- doc/wifi_adb_toolbox.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/wifi_adb_toolbox.md diff --git a/doc/wifi_adb_toolbox.md b/doc/wifi_adb_toolbox.md new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/doc/wifi_adb_toolbox.md @@ -0,0 +1 @@ + From 3bc84ee385e6e24db075067d129a0ce3826f2b6e Mon Sep 17 00:00:00 2001 From: Andika Rusli <60590034+kakrusliandika@users.noreply.github.com> Date: Tue, 14 Oct 2025 01:28:22 +0700 Subject: [PATCH 2/3] Update wifi_adb_toolbox.md --- doc/wifi_adb_toolbox.md | 184 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 184 insertions(+) diff --git a/doc/wifi_adb_toolbox.md b/doc/wifi_adb_toolbox.md index 8b13789179..4db684278d 100644 --- a/doc/wifi_adb_toolbox.md +++ b/doc/wifi_adb_toolbox.md @@ -1 +1,185 @@ +# ADB over Wi-Fi quick guide (with optional toolbox) + +This page explains how to use **ADB over Wi-Fi** with **scrcpy**, on Windows, macOS, and Linux. +It also links to an optional third-party “Wi-Fi ADB Toolbox” that automates common tasks. + +> **Note:** scrcpy works over USB or Wi-Fi. Wi-Fi is convenient for mobility, but **do not** expose ADB over TCP to untrusted networks. + +--- + +## Prerequisites + +- **Android device** with **Developer options** enabled. + - For Android ≤10: classic TCP/IP mode (`adb tcpip 5555`). + - For Android 11+ (recommended): **Wireless debugging** with **pairing**. +- **ADB** (Android Platform Tools) available in your `PATH`. +- **scrcpy** installed and available in your `PATH`. +- **Phone and computer on the same Wi-Fi/SSID** (same LAN segment). +- Allow your firewall to let `adb` communicate on the local network (port **5555** for classic TCP/IP mode, and a random port for **pairing** on Android 11+). + +--- + +## Quick commands + +### Windows (PowerShell or CMD) + +#### A) Classic TCP/IP (Android ≤10 or if you prefer tcpip mode) + +1. Connect the phone via **USB** once and authorize the RSA prompt. +2. Enable TCP mode: + ```bat + adb devices + adb tcpip 5555 + ``` +3. Find your phone IP (on the phone: Wi-Fi details) or via ADB: + ```bat + adb shell ip -o -4 addr show wlan0 + ``` +4. Connect and start scrcpy: + ```bat + adb connect :5555 + scrcpy + ``` +5. (Optional) Quality presets: + ```bat + scrcpy --video-bit-rate 8M --max-size 1080 :: Default + scrcpy --video-bit-rate 16M --max-size 1440 :: High + scrcpy --video-bit-rate 32M --max-size 2160 :: Ultra + ``` +6. Return to USB later (when reconnected by cable): + ```bat + adb -s :5555 usb + ``` + +#### B) Wireless debugging pairing (Android 11+) + +1. On the phone: **Developer options → Wireless debugging → Pair device with pairing code**. + Note the **IP:PORT** and 6-digit **pairing code**. +2. Pair: + ```bat + adb pair : + (enter the 6-digit code when prompted) + ``` +3. Connect the device endpoint (usually `:5555`): + ```bat + adb connect :5555 + scrcpy + ``` + +--- + +### macOS / Linux (Terminal) + +Commands are the same: + +#### A) Classic TCP/IP +```bash +adb devices +adb tcpip 5555 +adb shell ip -o -4 addr show wlan0 +adb connect :5555 +scrcpy +``` + +#### B) Wireless debugging (Android 11+) +```bash +adb pair : # enter the 6-digit code +adb connect :5555 +scrcpy +``` + +--- + +## Optional helper (third-party) + +For a friendlier workflow (menus, presets, JSON inventory, and cross-platform helper), see: + +- **Wi-Fi ADB Toolbox** (third-party): + + +This project automates the steps above (connect, list, presets, disconnect, etc.). +It is external to scrcpy; please report issues and updates there. + +--- + +## Network & security notes + +- **Local network only.** Avoid enabling ADB TCP on public or untrusted networks. +- **Unique IP per device.** If multiple phones share the same hotspot/router IP range (e.g. captive hotspot or phone-as-hotspot), ensure each device gets a unique IP. Duplicate IPs will cause conflicts. +- **Firewalls.** Allow `adb` through your OS firewall for private networks. Classic TCP mode uses **5555/TCP**; Android 11 pairing uses a **random TCP port** for the pairing step. +- **Disable when done.** For classic TCP mode, switch back to USB: + ```bash + adb -s :5555 usb + ``` + Or just reboot the device. + +--- + +## Troubleshooting + +- **`device unauthorized`** + Reconnect USB, accept the RSA fingerprint prompt. You can also revoke authorizations on the phone (Developer options → Revoke USB debugging authorizations), then re-authorize. + +- **`offline` or not listed** + Toggle **Wireless debugging** off/on (Android 11+), or run: + ```bash + adb kill-server + adb start-server + adb devices + ``` + Ensure phone and PC are on the **same SSID**. + +- **Cannot find phone IP** + Use: + ```bash + adb shell ip -o -4 addr show wlan0 + adb shell ip -o -4 addr show # check other Wi-Fi/P2P interfaces (e.g. p2p0) + ``` + Or read the IP from the phone’s Wi-Fi settings. + +- **Multiple devices error (`more than one device/emulator`)** + Specify the target with `-s`, e.g.: + ```bash + adb -s :5555 shell getprop ro.product.model + scrcpy -s :5555 + ``` + +- **Pairing fails (Android 11+)** + Ensure you use the **pairing port** for `adb pair` (not 5555), and the **6-digit code** shown on the phone. After pairing, connect to `:5555`. + +- **scrcpy not found** + Install scrcpy and ensure it’s in `PATH`. Launch `scrcpy -v` to verify. + +- **HEVC/H.265 option doesn't work** + The device must support HEVC encoding. If not, omit `--video-codec=h265`. + +--- + +## Useful commands (reference) + +```bash +# List devices (USB/TCP) +adb devices + +# Check state for a specific endpoint +adb -s :5555 get-state + +# Disconnect a specific endpoint or all +adb disconnect :5555 +adb disconnect + +# Classic mode: enable/disable TCP server on device +adb tcpip 5555 +adb -s :5555 usb + +# scrcpy examples +scrcpy # defaults +scrcpy --video-bit-rate 8M --max-size 1080 +scrcpy --always-on-top --fullscreen +scrcpy --record session.mp4 +``` + +--- + +*This page links to a third-party helper for convenience. It is not part of scrcpy and is maintained separately.* From 7c210ee18110babf7681d24acf09346e3e95fa59 Mon Sep 17 00:00:00 2001 From: Andika Rusli <60590034+kakrusliandika@users.noreply.github.com> Date: Tue, 14 Oct 2025 01:30:58 +0700 Subject: [PATCH 3/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 195706f61f..973f3f1f19 100644 --- a/README.md +++ b/README.md @@ -157,7 +157,7 @@ documented in the following pages: - [Camera](doc/camera.md) - [Video4Linux](doc/v4l2.md) - [Shortcuts](doc/shortcuts.md) - + - [Wifi](doc/wifi_adb_toolbox.md) ## Resources