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.

How to safely update your rooted Verizon Samsung Galaxy S5 to to the NK2 build

Because xda-developers instructions – like most forum guides – are poorly written.

This post assumes you’ll be updating from the NCG (Android 4.4.2) build the Verizon Samsung Galaxy S5 (SM-G900V) was released with. This method will not affect your files or apps on internal storage or the SD card in any way, so don’t worry about your phone being wiped.

  1. Ensure drivers for your phone are installed.
  2. Ensure towelroot is installed so you can easily re-root later.
  3. Ensure the System Updates app, SDM 1.0, is enabled. You’ll need it for the OTA update in a later step.*
  4. Ensure SuperSU is already installed.
  5. In Settings, tap Security.
  6. Under FIND MY MOBILE, uncheck the Reactivation lock box to prevent your SIM card being borked during the process.

    Note: do NOT proceed to Step 7 until Steps 1-6 have been completed.
  7. Download G900V_NK2_Stock_Kernel.tar.
  8. Download G900V_NCG_Stock_Kernel.tar.
  9. Download G900VVRU1ANHA_G900VVZW1ANHA_VZW.zip.
  10. Download ODINv3.10.rar.
  11. Decompress all the above .zip and .rar archives only. Do not decompress the .tar file(s).
  12. Turn off the S5.
  13. Hold Volume Down + Home + Power simultaneously to enter Download Mode.
  14. Press Volume Up to continue as indicated onscreen.
  15. Launch Odin from its decompressed folder.
  16. Connect the S5 to your PC via USB 2.0+ cable. This should result in Odin detecting the phone as below:

    Note the highlighted slot and "Added" message which indicate Odin's detection of the S5
    Note the highlighted slot and “Added” message which indicate Odin’s detection of the S5
  17. In the Odin window in the Files [Download] section, check the AP box.
  18. Click the AP button and select the G900VVRU1ANHA_G900VVZW1ANHA_G900VVRU1ANHA_HOME.tar file, found in the decompressed G900VVRU1ANHA_G900VVZW1ANHA_VZW.zip folder.
  19. Click Start. The S5 will update and boot into to the NHA build.
  20. In the S5’s Settings, tap System Updates.
  21. Tap Check for new software update.
  22. Accept, download, and install the available OTA NK2 update.
  23. When the S5 has successfully rebooted, turn it off.
  24. Put the S5 into Download Mode again as in Step 13.
  25. Repeat Steps 16 to 18 for the G900V_NCG_Stock_Kernel.tar file, with the exception that the S5 will now boot into the NK2 build, albeit running on the *NCG kernel.
  26. Open towelroot.
  27. Tap make it rain and wait for the rooting process to complete.
  28. Reboot the phone if towelroot doesn’t do that automatically.
  29. Open SuperSU and let it update the binary normally if it prompts you to do so.
  30. Repeat Steps 22 to 24 for the G900V_NK2_Stock_Kernel.tar file. The S5 will now boot into the NK2 build with matching kernel and root access.

*If you forget to do this, you won’t be able to OTA update in Step 18. In that case, follow Step 23, boot into the NHA build on the NCG kernel, and then root. Reboot and re-enable SDM 1.0, then continue the process at Step 18.

Credit JTidler & muniz_ri for the above instructions. I wrote this guide as an easier to understand and follow version for users like myself who don’t flash kernels and images as a matter of course.