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.

Izzy
  • 91,536
  • 76
  • 351
  • 968
Kshitiz Sharma
  • 489
  • 2
  • 5
  • 13

4 Answers4

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.

Anthony
  • 141
  • 3
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.

Vadzim
  • 462
  • 3
  • 9
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

Ryan Conrad
  • 22,683
  • 9
  • 59
  • 81
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
cardamom
  • 131
  • 4