ADB Watchdog

On-device Android watchdog that keeps wireless ADB enabled. When ColorOS (or any aggressive OEM ROM) silently turns wireless debugging back off, ADB Watchdog flips it on again automatically.

AndroidKotlinWireless ADB WRITE_SECURE_SETTINGSAccessibilityServiceColorOS

View the source on GitHub →

What it does

It polls Settings.Global.adb_wifi_enabled. When that flag goes to 0, it restores it to 1 through two recovery paths:

One-time permission grant

WRITE_SECURE_SETTINGS can't be requested at runtime — grant it once over USB ADB:

adb shell pm grant com.luffy.adbwatchdog android.permission.WRITE_SECURE_SETTINGS

This persists across reboots. After that, recovery is instant.

Build

./gradlew :app:assembleDebug
adb install -r app/build/outputs/apk/debug/app-debug.apk

Requires JDK 17 and Android SDK 34, or just open it in Android Studio.

Who it's for

Anyone running a phone (originally a Realme Narzo 50 on ColorOS) as a headless or always-on ADB target, where the OS keeps disabling wireless debugging. Full setup, the ColorOS keepalive checklist, and limitations are documented in the README on GitHub.