19
> adb shell
sh-4.1$ su
Permission denied

I have rooted my phone successfully. I know this because I'm able to install apps on SD card and I have a program called SD Maid that is able to operate with root permissions.

8
  • Installing apps on SDCard does not necessarily require root, and SDMaid also (partially) works without, so that's no proof. Your quote from the shell, on the other hand, seems to prove you were not successful with your rooting. When checking your installed apps, is there either SuperUser or SuperSU available? Do you get prompts like "SDMaid requested root permissions" which you need to confirm?
    – Izzy
    Commented Feb 21, 2013 at 11:38
  • @Izzy I get notifications like SD Maid has been granted super root permissions? Besides I just installed play.google.com/store/apps/… and it does ask me for super user confirmation which gets granted successfully. Commented Feb 21, 2013 at 11:50
  • @Izzy I would beg to differ. Installing apps on SDCard does require rooting your phone. Could you point to a contrary example? Commented Feb 21, 2013 at 12:33
  • Sure: Go to Settings->Apps->Manage Apps, and walk through them. Apps supporting it can simply be moved by tapping the corresponding button. Second: Take a look at AppMonster, right in the first screenshot, below the "moon icon" of "Sleepy Timer": this app supports App2SD, without root. AppMonster can move it (not requiring root), and even will offer to do so. App2SD is supported natively since Android 2.2. Follow the tag FAQ: App2SD
    – Izzy
    Commented Feb 21, 2013 at 13:01
  • 1
    For the previous comment: OK, so full ack that root worked. Again, please check your apps for SuperUser/SuperSU, this time start the app. In its configuration, it should let see you which permissions it has stored; maybe you once accidentally checked "remember" and hit the "deny" button for adb shell. If you find a corresponding entry, simply remove it. Next time you should be asked again, then make sure to hit the correct button :)
    – Izzy
    Commented Feb 21, 2013 at 13:05

4 Answers 4

14

From here:

You might need to activate adb root from the developer settings menu. If you run adb root from the cmd line you can get:

root access is disabled by system setting - enable in settings -> development options

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.

2
  • 7
    This setting is not available in all ROMs (couldn't find it e.g. in my LG Optimus 4X, which of course is rooted). IMHO this is a speciality of CyanogenMod.
    – Izzy
    Commented Apr 21, 2013 at 12:27
  • what do you know about Android, dude? > 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.
    – Nizzy
    Commented Apr 18, 2015 at 20:05
3

Nowadays Magisk is commonly used for rooting.

I've found that on my Oneplus 5 (Oxygen OS, Nougat) it was sufficient to go to Magisk Manager app, open superuser permissions screen and toggle Shell (com.android.shell) to resolve the adb su permission denied problem.

2
  • Could not find Shell (com.android.shell) in Magisk. Probably this changed in more recent versions of Magisk, as there's no full list of apps to choose from now.
    – tanius
    Commented Aug 26, 2021 at 14:52
  • 1
    On my device running LineageOS the option is called Rooted Debugging
    – saiedmomen
    Commented Oct 3, 2023 at 10:52
2

There is an app on Google Play called ADBD Insecure by Chainfire. This app lets you run adbd in root mode if your device is rooted when running the devices Stock ROM. I just recently found out about this app.

The version on Google Play is not Free, but there is a free version available. The link to the free version is linked in the description of the application in Google Play.

What is great about this app, it works with Stock ROMs that have been rooted. If you are using a custom kernel, or a custom ROM, you probably won't need this application. But if you are still using a stock rom, just rooted, then you may want to get this application for your device.

adbd Insecure lets you run adbd in root mode if your device is rooted. (Note that if you are running a custom kernel, it is likely that it already implements this functionality)

If you are running a stock (made by the phone manufacturer) kernel on your device, chances are adbd is running in "secure" mode, even if you are rooted. This app lets you run adbd in "insecure" mode, which gives you root access in "adb shell", allows access to system files and directories through "adb push/pull", and lets you run the "adb remount" command to make your /system partition writable.

enter image description here

1
  • I've tried free ADBD Insecure app from original XDA thread on my Oneplus 5 Nougat rooted with Magisk but it didn't help and also broke MTP connectivity in USB debugging mode until the phone was rebooted.
    – Vadzim
    Commented Jan 28, 2018 at 15:18
2

Enable root access for adb from the developer settings menu. Then connect your usb cable and type:

adb root

It should return

restarting adbd as root

Now relaunch the shell

adb shell
3
  • 2
    Stock Android provides no "root access for adb" in Dev Options. adb root is only possible on userdebug ROMs: Why “adb root” does nothing? Commented Dec 10, 2019 at 15:00
  • For rooted Android ROMs without "root access for adb" in Dev Options, there is a Magisk plugin adb_root that provides the equivalent. (Disable when not in use, due to security limitations.)
    – tanius
    Commented Aug 26, 2021 at 14:55
  • "adbd cannot run as root in production builds" Getting this error. How to fix this? Commented Nov 7, 2023 at 4:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .