I rooted my unlocked Galaxy S3 (SGH-T999)
Now, I'm trying to run adb root
from Windows Command Prompt, however, I'm getting adbd cannot run as root in production builds
error. So, the very first thing I checked was whether my phone was really rooted?
So I tried the following:
Open Command prompt
$adb devices // lists my device
$adb shell //goes to shell
$su // opens a 'SuperSu' prompt on my phone and I 'Grant' permission
# // Before following the rooting instructions, I was getting 'no su command found' in the previous step. So, I believe my phone is ROOTED. **Correct me if I'm wrong.**
However, when I do adb root
, I get adbd cannot run as root in production builds
error.
So, I thought, I might have to do some additional stuff beyond what I did above. I tried all the solutions in the following SO questions:
None of the above worked for me. All they do is give the ROOT access INSIDE of SHELL. I want adb root
to work so that I can execute various adb commands WITHOUT going into shell.
root access is disabled by system setting - enable in settings -> development options Once you activate the root option (ADB only or Apps and ADB) adb will restart and you will be able to use root from the cmd line.
You don't need to be rooted to use ADB, all android phones can use ADB without being rooted. You must be rooted to push applications to /system/apps/ to make them system applications.
If the ADB command is not found, most likely you need to install the Android SDK Platform-Tools package to make it available in the command prompt. Also, the phone should be in USB debugging mode.
Quantum, root is a user in Android having supreme privileges to do anything. ADB doesn't grant you rights enough to compare with root or system user. In short, there is no replacement for root access.
By design adb root
command works in development builds only (i.e. eng
and userdebug
which have ro.debuggable=1
by default). So to enable the adb root
command on your otherwise rooted device just add the ro.debuggable=1
line to one of the following files:
/system/build.prop
/system/default.prop
/data/local.prop
If you want adb shell
to start as root
by default - then add ro.secure=0
as well.
Alternatively you could use modified adbd
binary (which does not check for ro.debuggable
)
From https://android.googlesource.com/platform/system/core/+/master/adb/daemon/main.cpp
#if defined(ALLOW_ADBD_ROOT)
// The properties that affect `adb root` and `adb unroot` are ro.secure and
// ro.debuggable. In this context the names don't make the expected behavior
// particularly obvious.
//
// ro.debuggable:
// Allowed to become root, but not necessarily the default. Set to 1 on
// eng and userdebug builds.
//
// ro.secure:
// Drop privileges by default. Set to 1 on userdebug and user builds.
In some developer-friendly ROMs you could just enable Root Access in Settings > Developer option > Root access. After that adb root
becomes available. Unfortunately it does not work for most stock ROMs on the market.
I ran into this issue when trying to root the emulator, I found out it was because I was running the Nexus 5x emulator which had Google Play on it. Created a different emulator that didn't have google play and adb root
will root the device for you. Hope this helps someone.
I use for enter su mode in abd shell
adb shell "su"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With