Method B — ADB Manual Setup

Advanced · Requires a PC once

One-time setup You only need to run this command once. After that, no PC connection is needed to use ADB Toggle.

The permission command

This is the exact command to run. It grants WRITE_SECURE_SETTINGS to ADB Toggle:

adb shell pm grant com.usbdebug.toggle android.permission.WRITE_SECURE_SETTINGS

After running this command, open ADB Toggle → Settings → ADB Manual → tap "Check permission" to confirm.

Step-by-step guide

  1. Enable Developer Options on your Android device.
    Settings → About phone → tap Build number 7 times. Then go to Settings → Developer options → enable USB debugging.
  2. Install ADB (Platform Tools).
    Download Android SDK Platform-Tools and extract the ZIP (e.g. to C:\platform-tools).
    Or, if you have Android Studio, ADB is already at
    %LOCALAPPDATA%\Android\Sdk\platform-tools\adb.exe
  3. Connect your device via USB and accept the prompt.
    A dialog on your phone will ask "Allow USB debugging?" — tap Allow.
  4. Open PowerShell or Command Prompt in the platform-tools folder.
    cd C:\platform-tools
    Verify connection:
    adb devices
    You should see your device listed as device (not unauthorized).
  5. Install ADB Toggle APK (if not yet installed via Play Store).
    adb install -r path\to\app-debug.apk
  6. Grant the permission.
    adb shell pm grant com.usbdebug.toggle android.permission.WRITE_SECURE_SETTINGS
    No output means success.
  7. Verify in ADB Toggle.
    Open the app → Settings → ADB Manual → tap Check permission. It should show "Permission granted".
adb is not recognized? Add C:\platform-tools to your PATH environment variable, or use the full path: C:\platform-tools\adb.exe. Alternatively, use the adb.bat script in the project root if you built from source.
  1. Enable Developer Options and USB debugging.
    Settings → About phone → tap Build number 7 times → Developer options → enable USB debugging.
  2. Install ADB via Homebrew (recommended).
    brew install android-platform-tools
    Or download Platform-Tools and add it to your PATH.
  3. Connect your device and accept the USB debugging prompt.
  4. Verify the connection.
    adb devices
  5. Grant the permission.
    adb shell pm grant com.usbdebug.toggle android.permission.WRITE_SECURE_SETTINGS
  6. Verify in ADB Toggle.
    Open the app → Settings → ADB Manual → Check permission.
  1. Enable Developer Options and USB debugging.
  2. Install ADB.
    # Debian / Ubuntu sudo apt install adb # Fedora / RHEL sudo dnf install android-tools # Arch sudo pacman -S android-tools
  3. Add udev rules (if device not recognized).
    sudo apt install android-sdk-platform-tools-common # or manually: https://github.com/M0Rf30/android-udev-rules
  4. Connect your device and accept the USB debugging prompt.
    adb devices
  5. Grant the permission.
    adb shell pm grant com.usbdebug.toggle android.permission.WRITE_SECURE_SETTINGS
  6. Verify in ADB Toggle.
    Open the app → Settings → ADB Manual → Check permission.

Verify manually (optional)

adb shell dumpsys package com.usbdebug.toggle | grep WRITE_SECURE_SETTINGS

Look for granted=true in the output.

What if USB debugging gets turned OFF?

When you toggle USB debugging off via the widget, the ADB connection drops. You can turn it back on by tapping the widget again on your device — no PC needed. The granted permission persists even when USB debugging is off.