On LineageOS how to disable *Rooted debugging* with `adb`?
Feb 19, 10:37pm

On LineageOS, the "Rooted debugging" option (also known as "ADB root") allows ADB to run with root privileges. If you want to disable rooted debugging via ADB, follow these steps:


1. Check Current ADB Root Status

First, verify if rooted debugging is enabled:

bash
adb root
  • If it returns adbd cannot run as root in production builds, rooted debugging is already disabled.
  • If it switches to root mode, proceed to disable it.

2. Disable Rooted Debugging

Use the following command to disable rooted debugging:

bash
adb root adb disable-verity adb shell setenforce 0 adb shell setprop service.adb.root 0 adb shell stop adbd adb start-server

Explanation:

  • adb root ensures you’re in root mode (if enabled).
  • setprop service.adb.root 0 disables root access for ADB.
  • stop adbd and start-server restart the ADB daemon to apply changes.

3. Verify the Change

Restart ADB and check the status:

bash
adb kill-server adb start-server adb shell
  • If the shell prompt shows $ instead of #, rooted debugging is disabled.

4. (Optional) Permanently Disable via Build.prop

If you want to permanently disable rooted debugging, edit /system/build.prop (requires root access):

bash
adb pull /system/build.prop

Add or modify this line:

ini
ro.debuggable=0

Then push it back:

bash
adb push build.prop /system/ adb reboot

5. Re-enable Standard ADB

After disabling rooted debugging, reconnect ADB in standard mode:

bash
adb usb

Feb 19, 10:37pm

This is a shared conversation and may include unverified content that doesn't reflect Mistral AI's views. Login to resume chatting.