Minimal Android app that toggles wireless ADB from a Quick Settings tile or notification. The tile shows the current IP address and port when available.
- Android 4.2+ (API 17) for the app; Quick Settings tile is available on Android 7.0+.
- Root (Magisk works).
The toggle runs:
- Enable:
setprop service.adb.tcp.port 5555; stop adbd; start adbd - Disable:
setprop service.adb.tcp.port -1; stop adbd; start adbd
This requires root because it restarts adbd and changes system properties.
- Open the project in Android Studio.
- Sync Gradle.
- Run on a device.
Gradle wrapper scripts are included, but the gradle/wrapper/gradle-wrapper.jar file is not generated in this environment. On your machine, run gradle wrapper once to generate it, or let Android Studio create/update the wrapper.
You can also run scripts/gen-wrapper.sh to generate the wrapper JAR if Gradle is installed.
To build everything from the command line:
./gradlew build
Build flavors are available to reduce footprint and features:
full: Quick Settings tile, persistent status notification (toggleable), connection list notification (toggleable), media buttons, schedule UI, monitoring rules.full21: Same asfull, but minSdk 21 and uses frameworkMediaSession(noandroidx.media).notify: persistent status notification only (forced on, no UI/config or settings).notifyconn: persistent status notification (toggleable) + connection list notification (toggleable).tile: Quick Settings tile only (no notifications, no UI/config).basic: Quick Settings tile + persistent status notification (toggleable). No schedule, media, or connection list.headless: No UI, no notifications, no tile. Launch once to enable WiFi ADB and exit.
Select a flavor interactively or via -Pmode=notify (add -PnoPrompt=true to skip the prompt).
If you pass -PdeviceApi=23 and no mode is set, it defaults to notify (no tile on old Android).
- Android 4.2–6.x (API 17–23):
notify(tile is not available). - Android 7.0+ (API 24+):
tileif you only want QS control with no notifications.basicfor QS tile + status notification.fullif you need schedule/media/monitoring features.full21if you target API 21+ and want to avoidandroidx.media.headlessif you want a one-shot launcher that just enables WiFi ADB.
Release APKs:
./gradlew assembleFullRelease -Pmode=full -PnoPrompt=true./gradlew assembleFull21Release -Pmode=full21 -PnoPrompt=true./gradlew assembleNotifyRelease -Pmode=notify -PnoPrompt=true./gradlew assembleNotifyconnRelease -Pmode=notifyconn -PnoPrompt=true./gradlew assembleTileRelease -Pmode=tile -PnoPrompt=true./gradlew assembleBasicRelease -Pmode=basic -PnoPrompt=true./gradlew assembleHeadlessRelease -Pmode=headless -PnoPrompt=true
Debug APKs:
./gradlew assembleFullDebug -Pmode=full -PnoPrompt=true./gradlew assembleFull21Debug -Pmode=full21 -PnoPrompt=true./gradlew assembleNotifyDebug -Pmode=notify -PnoPrompt=true./gradlew assembleNotifyconnDebug -Pmode=notifyconn -PnoPrompt=true./gradlew assembleTileDebug -Pmode=tile -PnoPrompt=true./gradlew assembleBasicDebug -Pmode=basic -PnoPrompt=true./gradlew assembleHeadlessDebug -Pmode=headless -PnoPrompt=true
For notify and headless you can set defaults at build time:
- ADB port:
-PadbPort=5555 - Auto-enable on boot (headless):
-Pautoboot=true - Locales (default:
en, useallto disable filtering):-PresLocale=en - Densities (default for
notify/headless:nodpi):-PresDensities=nodpi - Direct boot aware receiver (LOCKED_BOOT_COMPLETED support):
-PdirectBoot=true - Enable actions during locked boot (earliest app-level boot hook):
-PlockedBoot=true - System app behavior (use SystemProperties if available):
-PsystemApp=true
Examples:
./gradlew assembleHeadlessRelease -Pmode=headless -PnoPrompt=true -PadbPort=5555 -Pautoboot=true
./gradlew assembleNotifyRelease -Pmode=notify -PnoPrompt=true -PadbPort=5555
./gradlew assembleNotifyRelease -Pmode=notify -PnoPrompt=true -PresLocale=en -PresDensities=nodpi
./gradlew assembleNotifyRelease -Pmode=notify -PnoPrompt=true -Pautoboot=true -PdirectBoot=true -PlockedBoot=true
./gradlew assembleNotifyRelease -Pmode=notify -PnoPrompt=true -Pautoboot=true -PsystemApp=true
./gradlew assembleNotifyRelease -Pmode=notify -PnoPrompt=true -PdeviceApi=22 -Pautoboot=true -PadbPort=5555 -PresLocale=en -PresDensities=nodpi
./gradlew assembleTileRelease -Pmode=tile -PnoPrompt=true -PdeviceApi=35
./gradlew assembleTileRelease -Pmode=tile -PnoPrompt=true -PdeviceApi=35 -PresLocale=en -PresDensities=nodpi
-PdirectBoot=truemarksBootReceiveras direct-boot aware.-PlockedBoot=trueallows handlingLOCKED_BOOT_COMPLETEDand only runs the minimal ADB enable path (no UI/notifications/settings access). It uses the compile-time port (-PadbPort) or 5555 by default.-PsystemApp=trueenables a system-app code path that tries to useandroid.os.SystemPropertiesinstead ofsu.
To actually run as a system/privileged app, you still need ROM-level integration:
- Install the APK into
/system/priv-app/(or/system/app/) and sign with the platform key. - Grant privileged permissions if required by your ROM (e.g.,
SET_PROP) via aprivapp-permissionsXML. - A true system service requires AOSP/framework integration; this project remains an app.
- Launch the app once.
- Add the
WiFi ADBtile to Quick Settings (Android 7.0+), or enable the persistent notification. - Tap the tile/notification to toggle wireless ADB.
- The tile subtitle shows
IP:5555(IPv4) or[IPv6]:5555when it can detect a non-loopback address. - If the tile says
no IP, connect to Wi-Fi or check network availability. - Optional ADB connection notification shows active client IPs when enabled (requires root).
- ADB port is configurable in-app; the UI will show the selected port.
- Root path uses
su -cand works with Magisk or other superuser managers.
- Tile service:
app/src/main/java/fuck/wifiadbtoggle/droidvendorssuck/AdbTileService.kt - Root runner:
app/src/main/java/fuck/wifiadbtoggle/droidvendorssuck/ShellRunner.kt - Toggle logic:
app/src/main/java/fuck/wifiadbtoggle/droidvendorssuck/AdbWifiController.kt