Unable to run 'adb root' on a rooted Android phone [duplicate]
Asked Answered
P

1

43

After rooting my device, I need to run adb root and then adb shell so I could then access my applications database. When trying to run adb root I keep getting "adbd cannot run as root in production builds". Why is this? The only other option is to use the Android emulator for testing, but we all know how terrible the emulator is (not really a viable development solution).

Pheasant answered 21/8, 2013 at 23:13 Comment(2)
Speaking of accessing your app's directory in /data/data, you can do that even on a fully stock and bootloader-locked device using the run-as <package> command in the adb shell provided your app has debuggable="true" in its manifest.Candlestick
the (self-)accepted answer does not solve the title problem. For that see https://mcmap.net/q/121640/-adb-shell-su-works-but-adb-root-does-not/1778421Kenishakenison
P
54

I finally found out how to do this! Basically you need to run adb shell first and then while you're in the shell run su, which will switch the shell to run as root!

$: adb shell
$: su

The one problem I still have is that sqlite3 is not installed so the command is not recognized.

Pheasant answered 21/8, 2013 at 23:13 Comment(5)
@clu after running adb shell I get following 127:shell@android:/$ However su is not recognized...please helpMidland
@Midland make sure your device is rooted of course (when I run su on my device, I get a SuperSU prompt on the device where I have to press "grant"); Additionally, this may be unrelated, but I also have busy box 1.20.2 installed on my device (for the TotalCommander add-in to function properly), so if your device is rooted and you still can't su, try installing Busy Box maybe? (Otherwise, my device is fresh.)Sweitzer
Above two steps worked. Not it is saying me root@c5302:/ # Then I entered adb root but it said device not found.Spearing
@Midland You need a rooted device and need to install superSU as well.Ordinance
After typing in su, it's retuning the following: [-] Connection to ui timed outGrenade

© 2022 - 2024 — McMap. All rights reserved.