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).
Asked
Active
Viewed 1.2e+01k times
43
-
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
` command in the adb shell provided your app has debuggable="true" in its manifest. – Grishka Aug 09 '16 at 01:49 -
the (self-)accepted answer does not solve the title problem. For that see https://stackoverflow.com/q/25477424/1778421 – Alex P. Jul 05 '17 at 18:56
1 Answers
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.

b.lyte
- 6,518
- 4
- 40
- 51
-
1
-
44@clu after running `adb shell` I get following `127:shell@android:/$` However `su` is not recognized...please help – aspiring Nov 26 '13 at 16:01
-
5@aspiring 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.) – BrainSlugs83 Mar 14 '14 at 22:29
-
1Above two steps worked. Not it is saying me `root@c5302:/ #` Then I entered `adb root` but it said device not found. – Srujan Barai Aug 28 '15 at 17:43
-
1
-
After typing in su, it's retuning the following: [-] Connection to ui timed out – Red M Jul 05 '17 at 20:26