Android: adbd cannot run as root in production builds

AndroidAdbRoot

Android Problem Overview


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?

Android Solutions


Solution 1 - Android

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.

Solution 2 - Android

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.

Solution 3 - Android

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.

Solution 4 - Android

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!

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionDaveView Question on Stackoverflow
Solution 1 - AndroidDavid Ljung Madison StellarView Answer on Stackoverflow
Solution 2 - AndroidFreemanXView Answer on Stackoverflow
Solution 3 - AndroidYong YangView Answer on Stackoverflow
Solution 4 - AndroidkuroView Answer on Stackoverflow