If an Android user debug build comes with adb root access by default, does it contain the su binary to achieve this?

If not, is it any different to rooting your phone?


No, adb does not require a su binary to get root permissions.

On a regular build it is just the other way around: adbd is started by the Android system itself with root permissions. Up to a certain point it uses these root permissions (open port and so on) and then adbd drops the root permissions.

On an Android user debug build comes with adb root access adbd does not drop the root permissions, hence every command executed via adb is executed also with root permissions.

  • So when someone "roots" their device using the su binary , does it just enable them to run adbd using root permissions? And does the using su binary provide root permissions anywhere else that a userdebug build does not? – Ramesh Joshi Nov 3 '20 at 17:26
  • @RameshJoshi adbd and su are totally independent from each other. Each of them does not use the other on it's own. On a rooted device (where adbddoes not run in root mode) however you can inside the shell provided via adb (adb shell) execute commands with root permissions via su but that is a different topic because in this case you as the user use su, the adb shell is just the "stage" you are working on. – Robert Nov 3 '20 at 17:36

I just built a userdebug version of AOSP 10.0 for my Pixel 4 XL; it does contain an su binary in /system/xbin/su.

It differs from what many mean by "rooting" in that it doesn't let you actually run su from on the phone itself (say, within termux). It can only be executed by root or a member of the shell group, which is what is used while running an adb shell session. However, it still is a way to run things as root; it merely requires an adb connection to do so. If your USB cable doesn't carry data or your USB port is broken/faulty, you wouldn't be able to run things as root anymore (unless you had already set up adb on the device to run over TCP).

I later put magisk on my otherwise-AOSP ROM and now have two su binaries; the magisk one is installed in /sbin/su. Magisk's /sbin/su will let me run things as root without an adb connection active.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.