How can I get root permissions in a terminal?
Production phones don't ship with root access, developer phones do. If you have a production phone (likely: you'd know if you bought a dev phone), you have to "root" them first. As @Joe_Casadonte points out, there are some great instructions here and elsewhere (Notably the CyanogenMod Wiki and Android Rom's google group) to get you started rooting your phone. (And if you get stuck ... come back here with your questions!).
Once you've rooted your phone, you can gain root privileges in the adb shell or the terminal emulator with the
Note: it sounds from some of your responses like you haven't yet rooted your phone. So you'll need to start there.
- Your Android device is rooted;
subinary is located at
- The shell binary is located at
- Your Android device has Terminal Emulator installed.
If all the 4 conditions above are satisfied, then:
If you want to enter the shell and become root (superuser uid 0) so you can execute commands without uid restrictions, start the Terminal Emulator app and just execute this command:
In order to disconnect from the uid 0 (exit superuser status), press Volume - and D, or type
exitand hit Enter
Alternatively, if you want to always start Terminal Emulator as root, then start Terminal Emulator, go to Preferences, scroll down to the SHELL section, tap the Command line option and modify the command so it becomes this:
/system/xbin/su -c "/system/bin/sh -"
After you change the command, exit Terminal Emulator (close the application) and start it again. Notice how Terminal Emulator's shell interface now shows you
For my 8.1.0 go edition phone. It is
/sbin/su -c "/system/bin/sh -". I struggle too much to figure out where is
su binary file(in my case
su binary not exist in the
/system/xbin/ path). I found a path
/sbin/ is exist in ROOT directory and
su binary is exist in that path. And of course i rooted my phone by magisk manager. Hope this answer will help someone.