Android: adbd cannot run as root in production builds
Asked Answered
B

5

73

I have an Android-based phone (2.3.6) with unlocked root privileges. Since i'd like to have access to my phone through my computer, today i've installed QtAdb and Android SDK. If i open a command prompt and i do

adb shell su

i get

#

And so I am able to copy, remove, push files on my phone (on the phone i get a notification using the app "SuperSU".)

But if i launch QtAdb - under Windows 7 - i get the following error: "adbd cannot run as root in production builds". I miss something? There's something wrong with QtAdb?

Bobbe answered 12/8, 2014 at 18:48 Comment(5)
"adb shell su" will not change what you can and cannot push or pull, so if you can access what you need to, then apparently you don't need root.Tsunami
I need to access to the whole filesystem of my phone. If i do "id", obviously i obtain "uid=0(root) gid=0(root)". I'd like to know why QtAdb told me "adbd cannot run as root in production builds".Bobbe
running a shell under su inside another shell does not change the uid under which adbd executes push and pull operationsTsunami
you could check out this thread android.stackexchange.com/questions/5884/…Selfrighteous
https://mcmap.net/q/121640/-adb-shell-su-works-but-adb-root-does-notPleat
L
42

The problem is that, even though your phone is rooted, the 'adbd' server on the phone does not use root permissions. You can try to bypass these checks or install a different adbd on your phone or install a custom kernel/distribution that includes a patched adbd.

Or, a much easier solution is to use 'adbd insecure' from chainfire which will patch your adbd on the fly. It's not permanent, so you have to run it before starting up the adb server (or else set it to run every boot). You can get the app from the google play store for a couple bucks:

https://play.google.com/store/apps/details?id=eu.chainfire.adbd&hl=en

Or you can get it for free, the author has posted a free version on xda-developers:

http://forum.xda-developers.com/showthread.php?t=1687590

Install it to your device (copy it to the device and open the apk file with a file manager), run adb insecure on the device, and finally kill the adb server on your computer:

% adb kill-server

And then restart the server and it should already be root.

Luigi answered 21/1, 2015 at 15:7 Comment(4)
enabling the patch disables the USB debugging on Nexus 5X. Any options ?Gratification
The app never asks for permission, yet is saying that I need to give it permission. Any ideas? (adb installed)Poss
What do you mean by "is saying that I need to give it permission"? Your phone does need to be rooted, and you need to make sure if you have any apps that limit root availability (such as Greenify) that they allow that app to have root.Luigi
I get the following when I click on the file inside emulator: adbd Insecure SuperUser access is needed but could not be acquired. Are you rooted and did you give permission?Dispirit
A
22

For those who rooted the Android device with Magisk, you can install adb_root from https://github.com/evdenis/adb_root. Then adb root can run smoothly.

Ambulance answered 10/6, 2020 at 14:38 Comment(4)
This worked for me. I can now run adb root from my computerGlossology
I tried this on a rooted Pixel 4 (Android 11) using Magisk, unfortunately the same error still appears despite installing the abd_root module successfully: "adbd cannot run as root in production builds"Salahi
@Salahi ADB Root is ARM64 only, maybe that's the problem.Orchestral
adb root shell adbd cannot run as root in production buildsCarlicarlick
F
6

if anyone is still having issues, heres how i fixed it

you have to start the shell with the phone and go into the magisk app and in the superuser tab (bottom) you have to enable root access for the shell and it works!

Filmer answered 21/2, 2022 at 2:27 Comment(0)
R
6

Use adb shell; su;

I still have not found any other solution for android 12 rooted with magisk. adb_root does not work with android 12. adbd insecure does not work for me and throws error could not patch adbd.

Region answered 6/8, 2022 at 7:18 Comment(2)
that will first run a unprivileged shell, and after that shell ending it will run su on your computer. does not work.Horrid
Only runs unprivileged shell, not rootRocketeer
K
3

You have to grant the Superuser right to the shell app (com.anroid.shell). In my case, I use Magisk to root my phone Nexsus 6P (Oreo 8.1). So I can grant Superuser right in the Magisk Manager app, whih is in the left upper option menu.

Kevenkeverian answered 8/4, 2020 at 16:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.