Overview
Android’s wireless debugging feature allows you to connect ADB to devices over Wi-Fi. This requires a two-step process:- Pairing - Authenticate with a pairing code (one-time setup)
- Connecting - Connect to the device using its IP and port
Wireless debugging requires Android 11 or higher and must be enabled in Developer Options on the device.
POST /api/adb/pair
Pair with a device using wireless debugging. This is a one-time authentication step required before connecting.Request Body
Device IP address (e.g.,
"192.168.1.100")Pairing port shown in wireless debugging settings (usually
37xxx or 38xxx)6-digit pairing code shown on the device (e.g.,
"123456")Response
Whether pairing was successful
Raw output from the
adb pair commandExample Request
Example Response (Success)
Example Response (Failure)
Error Response
Returns400 if required fields are missing:
500 if ADB command fails:
How to Get Pairing Information
On the Android device:- Go to Settings → Developer Options
- Enable Wireless debugging
- Tap Pair device with pairing code
- Note the IP address, port, and 6-digit code
- Use these values in the API request within 60 seconds
POST /api/adb/connect
Connect to a device via wireless debugging. The device must be paired first (or on the same network and previously paired).Request Body
Device IP address (e.g.,
"192.168.1.100")Connection port shown in wireless debugging settings (usually
5555 or 4xxxx)Note: This is different from the pairing port!Optional custom label for the device. If not provided, the device brand and model will be auto-detected.
Response
Whether connection was successful
Raw output from the
adb connect commandSide Effects
On successful connection, the device is automatically:- Added to the saved devices list (or updated if it exists)
- Tagged with the current timestamp in
lastConnected - Auto-labeled with brand and model if no custom label is provided
Example Request
Example Response (Success)
Example Response (Already Connected)
Example Response (Failure)
Error Response
Returns400 if required fields are missing:
500 if ADB command fails:
How to Get Connection Information
On the Android device:- Go to Settings → Developer Options
- Enable Wireless debugging
- Note the IP address and port shown at the top (e.g.,
192.168.1.100:5555) - Use these values in the API request
Workflow
First-Time Pairing
- Enable wireless debugging on the device
- Call
/api/adb/pairwith the pairing code - Call
/api/adb/connectwith the connection port - Device is now connected and saved
Reconnecting Later
Once paired, you only need to call/api/adb/connect on subsequent connections (as long as the device hasn’t been unpaired).
Example: Complete Pairing and Connection
Troubleshooting
“Failed: Wrong pairing code”- The pairing code expires after 60 seconds
- Regenerate a new code on the device and try again
- Device and computer must be on the same Wi-Fi network
- Wireless debugging must still be enabled on the device
- Try re-pairing the device
- Device may have gone to sleep
- Re-enable wireless debugging on the device
- Reconnect using
/api/adb/connect
