How to start Android Terminal Emulator as root

As usual with Linux, anything beyond simple use cases is a minor ordeal.

Advertisements

UPDATE: This method seems to be causing the app to crash for some folks. I haven’t used the feature in a while and am unaware of a workaround.

You probably know the su or sudo commands on Linux, but those don’t seem to work in the Android terminal.* Fortunately, you can get around that via a terminal emulator setting. Here’s how to do that:

  1. Install Android Terminal Emulator.
  2. Open the above.
  3. Tap the options menu icon.
  4. Tap Preferences.
  5. Scroll down to Shell.
  6. Tap Command line.
  7. Enter /system/xbin/su -c "/system/xbin/bash -" as shown below.

    Screenshot_20160426-080222
    One thing Android does have in common with desktop Linux is even the simplest things are always unnecessarily complicated for the sake of engineering ideological purism.
  8. Tap OK.
  9. Back out of Preferences.
  10. Close the terminal window.
  11. Restart the app.
  12. Approve the root permissions request that pops up.

You’ll now have superuser permissions every time you start the terminal.

Thanks bitmaster2000 for the method.

 

*I suspect the main reason for this is Android doesn’t handle user/administrator/root accounts in the same manner desktop Linux does. On Android every app is a user in Linux parlance, while Android users are something else entirely.

Author: jdrch

ISTJ, Rice Owl, UF Gator, mechanical engineer. STEM, sports, music, movies, humor. Account mine only & unaffiliated.

15 thoughts on “How to start Android Terminal Emulator as root”

  1. I have another solution that the Webmaster could share, using QPython… (it might be ‘su’, ‘sh’ instead of ‘su’,’root’. But i think both will work depeding on the Android Version. (6.0 for me)

    1) Download & Install QPython

    2) create file : rootshell.py
    ————————-
    from subprocess import check_call
    subprocess.check_call([‘su’,’root’])

    3) Run it from QPython
    You got a Root Shell bro ! 😉

    When i need to run some python from this shell, i type:
    /data/user/0/org.qpython.qpy/files/bin/qpython-android5.sh “/data/media/0/Download/myscript.py”

    I would stay with my method simply because i have Python AND a shell in the same app.

    Like

Comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s