Skip to content

Wireless Debugging Setup

DP-Hridayan edited this page Nov 17, 2026 · 26 revisions

Note

Wireless Debugging operates over local Wi-Fi networks using TLS authentication (Android 11+), enabling cable-free ADB shell sessions locally on the host device or remotely to secondary devices.


Wireless Debugging Setup and Pairing Guide

Wireless Debugging provides a secure, cable-free Android Debug Bridge (ADB) connection operating over a local Wi-Fi network. Built upon TLS-authenticated pairing introduced in Android 11 (API level 30), Wireless Debugging allows aShellYou to establish ADB shell sessions without requiring a physical USB connection or a tethered workstation.

aShellYou supports two primary operational targets:

  • This Device (Self-Pairing): Authorizes and connects an ADB shell locally on the host device running aShellYou.
  • Another Device: Pairs with and remotely controls a secondary Android phone, tablet, or Android TV connected to the same local network.

Technical Prerequisites

Before initiating wireless pairing, ensure your environment satisfies the following requirements:

Component Minimum Specification Recommended
Android OS Android 11 (API level 30) Android 12 or higher
Network Shared 2.4 GHz or 5 GHz Wi-Fi network Stable Wi-Fi with Client Isolation / AP Isolation disabled
Developer Options Enabled in system settings Enabled with Wireless debugging toggled on
Permissions Notification permission granted (Android 13+) Required for background self-pairing notification entry

Note

Wireless Debugging requires both devices to reside on the same local subnet and communicate over multicast DNS (mDNS). Public Wi-Fi networks that enforce Client Isolation (such as hotel, airport, or enterprise networks) block direct peer-to-peer communication and prevent discovery.


Initial Setup and Target Selection

Step 1: Enable Wireless Debugging in Android Settings

  1. Open Developer Options:

    • Go to Settings > System > Developer options (or Settings > Additional settings > Developer options).
  2. Toggle Wireless Debugging:

    • Scroll to the Debugging section and toggle Wireless debugging to On.
  3. Authorize Network:

    • On the system prompt, check Always allow on this network and tap Allow.

Step 2: Choose Your Pairing Target in aShellYou

  1. Open Wireless ADB:

    • In aShellYou, select Wireless ADB from the navigation drawer.
  2. Select Pairing Mode:

    • Tap the pair button. When the Which device to pair? dialog appears, choose:
      • Pair this device: For running ADB commands locally on the current hardware.
      • Pair another device: For managing an external phone, tablet, or TV.

Android Developer Settings aShellYou Target Selector
Wireless Debugging in Settings Target Selection Dialog
Enable Wireless debugging in Developer options Choose between This Device or Another Device

Workflow A: Pairing This Device (Self-Pairing)

Self-pairing allows aShellYou to establish an ADB loopback session on Android 11+ without root privileges or a computer.

Step-by-Step Procedure

  1. Select Pair This Device:

    • Tap Pair this device in the target selector dialog.
    • Review the on-screen instructions. Ensure notification permissions are granted so the input banner can display.
  2. Launch Developer Options:

    • Tap the Developer options button at the bottom of the instruction card.
    • aShellYou immediately dispatches a system notification prompting for the pairing code.
  3. Initiate System Pairing:

    • In Developer options, tap directly on the Wireless debugging text (not just the toggle) to enter the sub-menu.
    • Select Pair device with pairing code. The system displays a 6-digit code and dynamic port.
  4. Enter Code in Notification:

    • Pull down the Android notification shade, locate the aShellYou pairing banner, enter the 6-digit code, and tap send.
  5. Connect to Terminal:

    • Once authenticated, tap Go to terminal on the connected device card to begin executing commands.

1. System Pairing Code Dialog 2. Notification Input Banner
System 6-Digit Pairing Code Dialog Notification Pairing Input
Dynamic 6-digit code in Developer options Enter code directly into notification shade

3. In-App Setup Instructions 4. Connected Device Profile
In-App Self-Pairing Instructions Own Device Connected Card
Pre-flight guidance and direct settings link Ready for interactive terminal execution

Tip

  • Once paired, you can enable permanent offline ADB port 5555 via the TCP/IP Setup Guide to eliminate future re-pairing after Wi-Fi reconnects.

Workflow B: Pairing Another Device

To control an external target device (phone, tablet, TV, or emulator), aShellYou provides two pairing methods:

Method Best For Prerequisites
QR Code Pairing Fastest workflow between phones with working cameras Target device running Android 11+ with a functioning rear camera
6-Digit Pairing Code Devices without rear cameras (Android TV, emulators, tablets) Target device supporting mDNS service discovery on the local network

Method 1: QR Code Pairing

  1. Display QR Code on Host:

    • In aShellYou on the Host device, navigate to the Pair using QR tab.
    • aShellYou generates and renders a unique cryptographic QR code on the screen.
  2. Open Scanner on Target:

    • On the Target device, go to Settings > Developer options > Wireless debugging.
    • Tap Pair device with QR code to open the system camera scanner viewfinder.
  3. Scan and Authenticate:

    • Point the Target camera at the Host screen. The devices automatically negotiate TLS keys and authenticate.
  4. Connect to Terminal:

    • Tap Go to terminal on the Success confirmation dialog to start your interactive shell.

Host Screen: QR Code Generator Target Screen: Camera Scanner
QR Pair Screen QR Scanner Viewfinder
aShellYou displays cryptographic QR on Host Point Target camera at Host screen to pair

Connection Success Dialog
Target connection success confirmation dialog

Method 2: 6-Digit Pairing Code (mDNS Discovery)

If either device lacks a camera or prefers manual code validation:

  1. Initiate Pairing on Target:

    • On the Target device, go to Settings > Developer options > Wireless debugging.
    • Tap Pair device with pairing code. Note the 6-digit code and pairing port.
  2. Discover Device on Host:

    • In aShellYou on the Host device, select the Pair using code tab.
    • aShellYou discovers the Target device broadcast over mDNS.
  3. Enter Code:

    • Tap the discovered device card, type the 6-digit code shown on the Target screen, and tap Pair.
  4. Connect to Terminal:

    • Upon verification, aShellYou connects to the target ADB service and opens terminal access.

Target Device: Pairing Dialog Host Device: Discovered Service
Target Pairing Code Dialog Discovered Device Card
Target reveals pairing code and IP/port Host discovers target via mDNS; enter code to pair

Managing Saved Devices and Dynamic Ports

Android assigns randomized dynamic ports to the Wireless Debugging daemon each time Wi-Fi disconnects or reboots. aShellYou automatically handles dynamic port discovery and profile management.


Saved Devices Tab
Saved wireless device management dashboard in aShellYou

Auto-Reconnection

  • When opening aShellYou on an already-paired Wi-Fi network, the app listens for mDNS advertisement beacons from your saved devices and updates their connection ports automatically.
  • Tap Reconnect on any saved device card to re-establish the ADB session without repeating the pairing handshake.

Device Management Actions

  • Go to terminal: Active when the device shows the green Connected status badge. Opens the interactive ADB terminal.
  • Disconnect: Gracefully terminates the active TCP/TLS connection while preserving paired authentication keys.
  • Forget Device: Long-press any saved device card and confirm the dialog to delete saved TLS certificates and device metadata.

Troubleshooting Matrix

Issue Root Cause Resolution
Notification does not appear during self-pairing Notification permissions blocked or OEM aggressive battery killing 1. Go to Settings > Apps > aShellYou > Notifications and enable all notifications.
2. On MIUI/HyperOS, ensure Notification Style is set to Android instead of MIUI under system notification settings.
Device not found during code discovery AP Isolation active on router or mDNS blocked 1. Ensure both devices are on the exact same Wi-Fi SSID and frequency band (e.g., both on 5 GHz).
2. Check router configuration to verify Client Isolation / AP Isolation is disabled.
3. Toggle Wireless debugging off and back on in Developer options.
"Connection Refused" after reboot Target device assigned a new dynamic port In Android Developer options, verify that Wireless debugging is toggled On. Tap Reconnect in aShellYou so mDNS can resolve the updated port.
Pairing fails with timeout 6-digit code expired The pairing code dialog expires after approximately 2 minutes. Tap Cancel on the target device, generate a fresh code, and enter it immediately in aShellYou.
Connection drops when screen turns off OS Wi-Fi power saver suspending background sockets Set aShellYou battery usage to Unrestricted in Android system settings.

Related Documentation

Clone this wiki locally