12

I use KUBUNTU on my laptop, but this goes for any Linux distro. I can open a terminal window and type in things like sudo apt-get update, sudo apt-get install packagename. Is there a terminal that can carry out commands like this on Android? It doesn't have to be "sudo", I simply mean carrying out commands. I use the Galaxy S3, but I doubt it really matter for the question I'm asking.

  • 3
    Did you check the Play Store? There quite a few terminal emulators. – eldarerathis Dec 27 '13 at 4:11
  • 1
    Android does not have the apt package manager – p1xel Dec 27 '13 at 5:25
  • Yes, but can I do something useful with these emulators with no root? On Ubuntu, you still can. – Mike Wentworth Dec 27 '13 at 22:34
  • Yes, at least one of them supports creating new apps in Java using ssh, rsync, vim, etc. from its terminal command prompt, even if you don't have root. – David Cary Jan 10 '14 at 14:08
  • You can get su and other common GNU commands by rooting your device and installing Busybox (busybox is usually installed while rooting) but you can't get apt since it's a package manager for Debian-based distros. Android is not a linux distro, the only common thing it has is the linux kernel. – Adonis K. Kakoulidis Sep 10 '15 at 12:16
12

Summing up from the comments:

First you need to understand that updating apps works different on Android than it does on a "normal" Linux distro: There is no such thing as "apt". Though Android has its own package manager (listening to the pm command), installs/updates are usually dealt with by services/apps like or other . pm would rather be comparable with dpkg on Debian-based systems: it can do local installs (i.e. with the .apk file already present on the device itself: pm install would be the command for that), and a lot of other things.

Apart from that: a terminal app can be compared with a terminal on Linux allright. You get a text-mode "window" where you can execute commands. Most are even similar to those available on Linux, as Android is Linux based: you have things like cd, ls, grep, and more. For details on this, you might wish to take a look at e.g.

A look into our terminal tag-wiki will not hurt either :)

I'd say all terminal apps available for Android should support the above. Some even offer additional features, such as an entire development environment (Terminal IDE), or access to remote servers (JuiceSSH).

  • Also worth mentioning, installing busybox adds all the commands "you know and love" – saloalv Jan 7 '15 at 18:09
  • Right, @saloalv – with the amount of commands depending on the version of Busybox :) Don't forget installing Busybox system-wide usually requires root. – Izzy Jan 7 '15 at 21:52
  • if it'd be possible to install !system-wide, it'd be great for non-rooted users. Unfortunately it seems that the sdcard partition is fat32, and as such the binary cannot be given execution rights – saloalv Jan 7 '15 at 22:51
  • 1
    @saloalv that's not even the culprit. But it is explicitely mounted with the noexec flag (for security reasons). – Izzy Jan 7 '15 at 23:56
3

There is a terminal app which uses "apt" to install packages. Its awesome and has lots of packages ported for arm devices -- Termux & Playstore Link

1

in present days there is the app "termux" on google play store. it comes with a full unix/linux shell and with apt. anything else should be straight forward then. downside: it does not support items like my Android 4.4.2 based tablet.

0

Install Terminal Emulator and Busybox in your Android. Terminal Emulator gives command-line window and Busybox APK gives useful commands that are used in Linux like wget, chmod, chroot and more.

  • Can you link the apps? – Firelord Oct 4 '15 at 11:44
0

Assuming that:

  1. Your Android device is rooted;
  2. The su binary is located at /system/xbin/su;
  3. The shell binary is located at /system/bin/sh; and
  4. 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:

    su -
    

    In order to disconnect from the uid 0 (exit superuser status), press Volume - and D, or type exit and 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 root@something by default.

If you want to add extra commands to your rooted Android system, install BusyBox.

In case your Android device isn't rooted, you still can use Terminal Emulator in order to execute some basic (user) commands such as blkid, cat, cd, clear, cp, du, grep, id, ln, ls, ping, sleep, uptime et cetera.

-2

Or you can use Gnu/Root Debian for android (GPlay)

  • Do you always buy the factory if you just want to rent a car? – Izzy Jun 16 '18 at 23:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.