On Android, you can check if adb root would succeed without actually running adb root or checking the UI by inspecting the ro.secure and ro.debuggable system properties. These properties are accessible via adb shell getprop.
Run the following command:
bashadb shell getprop ro.secure adb shell getprop ro.debuggable
ro.secure:
0: The device is not enforcing SELinux or secure policies, and adb root is more likely to succeed (if the build is also debuggable).1: The device is enforcing secure policies, and adb root will likely fail unless the build is explicitly debuggable.ro.debuggable:
1: The build is debuggable, meaning adb root is allowed (if ro.secure is 0 or the device is userdebug/eng build).0: The build is not debuggable, and adb root will fail.adb root will succeed if:
ro.secure is 0 ORro.debuggable is 1 (and the device is a userdebug/eng build).adb root will fail if:
ro.secure is 1 AND ro.debuggable is 0.If you run:
bashadb shell getprop ro.secure
and get:
text1
and:
bashadb shell getprop ro.debuggable
returns:
text0
→ adb root will fail.
If either property is 0 or 1 (respectively), test further or check the build type (adb shell getprop ro.build.type). Userdebug/eng builds often allow adb root even if ro.secure is 1.
Vibe can make mistakes. Check answers. Learn more