Native Wireless ADB Manager for Android & Windows
Automate Android Wireless Debugging, toggle USB & Wireless ADB without enabling Developer Options, and generate ready-to-run Windows PowerShell, CMD, and .bat connection commands.
- Screenshots
- Overview
- Features
- Direct USB & Wireless ADB Without Developer Options
- Architecture
- Platform Compatibility & Fallbacks
- Security & Privacy
- Quick Start
- Building & Release Signing
- License
Captured from the R8-minified release build (2.9 MB) running on Android 17 with KernelSU and Material You dynamic wallpaper theming.
Setting up Android Wireless Debugging with a Windows PC typically means digging into Settings -> Developer Options, toggling Wireless Debugging, approving network prompts, copying ephemeral IP/port numbers, switching screens for temporary pairing codes, and typing adb pair / adb connect by hand.
Relay eliminates the Android-side friction with a native Pixel-style Material 3 utility:
- Open Relay and tap Prepare Connection.
- Relay verifies real root execution, inspects Wi-Fi / IPv4, activates Wireless Debugging automatically (without opening Settings or enabling Developer Options), and retrieves the live TLS port.
- Tap Copy Windows Commands or Export
.batand run it in Windows Terminal (PowerShell or CMD).
Note: Android devices cannot unilaterally initiate an ADB session on a Windows PC. Relay automates everything on the Android device and generates accurate, executable Windows-side commands based on live device telemetry.
- Executes real root shell verification (
su -c "id -u; id; id -Z") with strict command timeouts and independent stdout/stderr readers — never assumes root simply because a manager app orsufile exists. - Detects Magisk, KernelSU, KernelSU Next, APatch, SuperSU, and generic
subinaries. - Cleanly distinguishes Granted, Denied, Revoked (including live mid-session revocation), and Unavailable states.
- Includes a 6-point interactive Root Access Diagnostics suite in Settings.
Retrieves the active TLS connection port reliably across Android 12 through Android 17 without inventing ports:
service.adb.tls.portsystem property (Android 12–16)IAdbManager.getAdbWirelessPort()Binder query via root (Android 12–17, including API 37use_tls_lifecycle)dumpsys adb(adb_wifi.tls_port,connected_to_adb,user_keys)- Android
NsdManagermDNS discovery (_adb-tls-connect._tcp.and_adb-tls-pairing._tcp.), strictly filtered to this device's IPv4 /persist.adb.wifi.guid - Kernel TCP socket inspection for
adbd(ss -H -t -a -p -nwith/proc/<pid>/fd+/proc/net/tcp{,6}fallback)
- Dedicated PowerShell and CMD tabs with token syntax highlighting, execution order indicators, individual copy buttons, and one-tap Copy Windows Commands.
- Supports both Already paired (
adb connect IP:CONNECT_PORT) and First-time pairing (adb pair IP:PAIRING_PORT CODEfollowed byadb connect IP:CONNECT_PORT), strictly keeping pairing and connection ports distinct. - Includes ADB executable checks, Windows PATH guidance,
adb devices -l,adb disconnect,adb mdns services, and local Windows ADB server reset commands. - Exports self-contained CRLF
.batscripts via Android's Storage Access Framework (CreateDocument) with automatic%LOCALAPPDATA%\Android\Sdk\platform-toolsprobing.
- Displays live connection state, IPv4, active port + detection source, transport mode,
adbddaemon PID, live session uptime, last attempt, and last successful endpoint. - Inspects real
ESTABLISHEDremote TCP sockets attached toadbd(never fabricates client hostnames) separately from authorized host keys stored in/data/misc/adb/adb_keys. - Lifecycle-aware foreground refresh only — zero background services.
Android's AdbService (AdbSettingsObserver and IAdbManager) does not gate on Settings.Global.DEVELOPMENT_SETTINGS_ENABLED — only the Settings UI hides those switches behind Developer Options.
With root granted, Relay controls debugging directly while keeping development_settings_enabled=0:
- USB Debugging: toggles
settings put global adb_enabled 1|0directly. - Wireless Debugging: reads the active Wi-Fi AP BSSID via
cmd wifi status(strictly validated against MAC format) and invokesIAdbManager.allowWirelessDebugging(true, bssid)viaservice call adb(transaction code resolved via reflection with AOSP ABI-stable fallback), atomically trusting the network inAdbKeyStoreand startingadbd's TLS server with zero Settings navigation and zero system popups. - In-App First-Time Pairing: starts Android's native pairing server via
IAdbManager.enablePairingByQrCode(serviceName, ephemeral6DigitCode)using aSecureRandomin-memory code, discovers the ephemeral pairing port over mDNS, and cleans up viaIAdbManager.disablePairing(). - Developer Options Bypass Indicator: displays live
development_settings_enabledstatus on the Dashboard and Settings with a one-tap Turn off action when Developer Options is currently on.
flowchart LR
UI["Jetpack Compose UI (6 Screens)"] --> VM["RelayViewModel (StateFlow)"]
VM --> ACM["AdbConnectionManager"]
VM --> CM["ConnectionMonitor"]
VM --> SM["SettingsManager (DataStore)"]
ACM --> RM["RootManager"]
ACM --> NM["NetworkManager"]
ACM --> WDM["WirelessDebuggingManager"]
ACM --> CG["CommandGenerator"]
CM --> RM
CM --> NM
CM --> WDM
WDM --> RM
WDM --> NM
app/src/main/java/dev/relay/wirelessadb/
├── MainActivity.kt # Edge-to-edge host + Material 3 dynamic theme
├── RelayApplication.kt # Explicit RelayContainer dependency graph
├── core/
│ ├── model/
│ │ ├── Models.kt # Immutable domain models & state enums
│ │ └── EndpointValidator.kt # IPv4, port, 6-digit code & shell safety validation
│ ├── root/RootManager.kt # Root shell execution, provider detection & diagnostics
│ ├── network/NetworkManager.kt # ConnectivityManager + cmd wifi status enrichment
│ ├── wireless/
│ │ ├── AdbParsers.kt # Pure dumpsys, binder parcel, ss & /proc/net/tcp parsers
│ │ └── WirelessDebuggingManager.kt # Direct USB/Wireless/Pairing automation + NsdManager
│ ├── commands/CommandGenerator.kt # PowerShell, CMD & secure .bat script engine
│ ├── monitor/ConnectionMonitor.kt # Live connection state, uptime & socket peer tracking
│ ├── settings/SettingsManager.kt # DataStore preferences (never persists pairing codes)
│ └── adb/
│ ├── AdbConnectionManager.kt # 6-step Prepare Connection orchestrator
│ └── TroubleshootingEngine.kt # Live 10-scenario diagnostic evaluator
└── ui/
├── RelayViewModel.kt # Reactive UI state, clipboard & export coordination
├── RelayApp.kt # Adaptive NavigationBar / NavigationRail + SAF export
├── theme/ # Material You dynamic color, Pixel fallback & typography
├── components/ # 8 custom composables + Windows command syntax highlighter
└── screens/ # Home, Setup, Windows Commands, Monitor, Settings, Troubleshooting
| Environment | Platform Behavior | Relay Handling |
|---|---|---|
| Android 12–16 (API 31–36) | adbd publishes TLS port to service.adb.tls.port and IAdbManager. |
Fast-path detection via system property + IAdbManager + dumpsys adb. |
| Android 17 (API 37) | use_tls_lifecycle sends TLS port via adbdauth instead of service.adb.tls.port. |
Automatically resolves port via IAdbManager.getAdbWirelessPort(), dumpsys adb, mDNS, and adbd listening sockets. |
| Non-rooted / Root denied | Apps cannot write Settings.Global or read /proc/<adbd_pid>/fd. |
Clean manual-assisted fallback: live IPv4 detection, mDNS discovery, validated manual IP/port/pairing inputs, and Settings shortcut. |
| Heavily modified OEM ROMs | Custom AIDL methods could shift Binder transaction IDs. | Resolves IAdbManager$Stub.TRANSACTION_* via reflection first; falls back to settings put global adb_wifi_enabled 1 with guided network-trust recovery. |
- Zero shell injection: local root execution uses strictly static platform commands (plus regex-validated MAC addresses and integer transaction codes); user inputs are never passed to
su. - Validated Windows output: every IPv4, port (
1..65535), and 6-digit pairing code is validated and screened against PowerShell/CMD metacharacters (& | ; < > ^ % $ \" '`) before command generation. - Volatile pairing credentials: temporary 6-digit pairing codes exist strictly in volatile memory, are marked
android.content.extra.IS_SENSITIVEon Android 13+ clipboard copies, and are never written to DataStore, logs, or exported.batfiles (batch scripts prompt interactively viaset /por insert<PAIRING_CODE>). - Minimal attack surface:
allowBackup="false",usesCleartextTraffic="false",dependenciesInfoandvcsInfostripped from release APKs, zero telemetry, zero external network traffic, and zero background services.
- Install Relay on your Android 12+ device and grant superuser access in Magisk, KernelSU, or APatch.
- Connect your Android device and Windows PC to the same Wi-Fi network.
- Open Relay and tap Prepare Connection (Developer Options does not need to be enabled).
- Tap Copy Windows Commands (or Export
.bat). - Open Windows Terminal (PowerShell or CMD) on Windows, paste, and press Enter.
- (First-time PC only) Switch to First-time pairing, tap Start In-App Pairing (No Settings), run the generated
adb paircommand, then runadb connect.
- JDK 17+ (CI uses Temurin JDK 21)
- Android SDK with Platform API 36 (
minSdk = 31,compileSdk = 36,targetSdk = 36) - Android Studio or the included Gradle wrapper (
./gradlew)
# Run JVM unit tests (CommandGenerator, EndpointValidator, AdbParsers)
./gradlew testDebugUnitTest
# Run Android Lint (0 errors, 0 warnings)
./gradlew lintDebug
# Build debug APK
./gradlew assembleDebug
# Build R8-minified release APK (unsigned unless keystore is configured)
./gradlew assembleReleaseCopy keystore.properties.example to keystore.properties (git-ignored) and fill in your release keystore details:
storeFile=/path/to/relay-release.jks
storePassword=your-store-password
keyAlias=relay
keyPassword=your-key-passwordAlternatively, supply environment variables (used by .github/workflows/release.yml when pushing v* tags):
RELAY_KEYSTORE_PATH(orRELAY_KEYSTORE_BASE64secret in GitHub Actions)RELAY_KEYSTORE_PASSWORDRELAY_KEY_ALIASRELAY_KEY_PASSWORD
To test the R8-minified release build on a local device without a production keystore:
./gradlew assembleRelease -PrelayDebugSignRelease=true
adb install -r app/build/outputs/apk/release/app-release.apkLicensed under the Apache License 2.0.





