Frequently Asked Questions
Clone this wiki locally
Is «Terminal Emulator for Android» the same app as «Android Terminal Emulator»?
Yes. The name was changed due to Google Play branding guidelines. Unfortunately Google Play does not allow applications that start with the word «Android».
What is a terminal emulator?
A terminal emulator is a program that makes your Android phone act like an old fashioned computer terminal. It is useful for accessing the Linux command line shell that is built into every Android phone. This lets you run various Linux command line utilities.
If you don’t know what all that means, and why it’s cool, then this probably isn’t the program for you. (Sorry!)
Help, I’m lost. How do I use the Android shell?
I’ve written a brief, incomplete, guide to using the built-in Android shell: Android Shell Command Reference
What sort of games does this emulator play?
Sorry, this is a terminal emulator, not a game emulator. It has nothing to do with games.
Does Terminal Emulator for Android allow me to «Root» or «Hack» my phone?
Sorry, no. Terminal Emulator for Android does not help you root or hack your phone.
How can I root or hack my phone?
I don’t know how to do that. I use «developer» edition Android phones that don’t need to be rooted, and I don’t have any interest in hacking phones. Maybe ask on an enthusiast web site like http://forum.xda-developers.com/
Is Terminal Emulator for Android useful on an ordinary phone, that hasn’t been rooted?
Yes! You can access the entire /sdcard file system, and you can install and run Linux command-line applications in the parts of the /data file system that are accessible to the Terminal Emulator for Android process.
You can also run command-line programs that access the Internet.
Why do I get «permission denied» errors when I try to run commands in the terminal?
This message is being printed out by the Android shell. It means one of two things:
It might simply mean that you have misspelled the command name, or are trying to use a command that is not installed on you device. The Android shell will print «permission denied» when it just can’t find the command, instead of a more accurate error message like «command not found».
It could mean that the command exists, but you don’t have permission to run it. By default Terminal Emulator for Android runs using the permissions of the Terminal Emulator for Android application. You may need to become «root» in order to gain permissions to run some commands. You can use the «su» command to do this. Of course, most consumer Android devices don’t have root access enabled by default, so you may not be able to use the «su» command on your device.
Why does Terminal Emulator for Android request Internet and Photos/Media/Files permissions?
By itself, Terminal Emulator for Android doesn’t access the Internet or Photos/Media/Files. However, many users of Terminal Emulator for Android want to run command line programs that do these things.
The way Linux (and therefore Android) works, a child process inherits the permissions of the parent. Terminal Emulator for Android requests the Internet and Photos/Media/Files write permissions so that the command-line programs that it runs can have access to the Internet and Photos/Media/Files stored on the device and any attached SD Cards.
So, for example without the Internet permission a command like
Similarly, without the Photos/Media/Files permission a command like
If giving these permissions to the terminal emulator makes you uncomfortable, you could download the source code to Terminal Emulator for Android and compile your own version. (Edit the AndroidManifest.xml file to remove the INTERNET and WRITE_EXTERNAL_STORAGE permissions.)
Why don’t the Arrow Keys / DPAD / Trackball work ?
They do work, sort of. They send the proper escape sequences for VT-100 terminal arrow keys. It is up to the «shell» to interpret these escape sequences.
Pre-Gingerbread (pre 2.3) versions of the default Android shell do not handle these escape sequences. Gingerbread (Android 2.3) and later versions of Android work correctly. But that doesn’t help people with older versions of Android.
If you have a Froyo (2.2) or earlier version of Android, you can fix this problem by installing an alternate shell, such as the one in Busybox. The Busybox «ash» shell recognizes the arrow escape sequences sent by the terminal emulator.
Even on newer versions of Android people sometimes run into this problem when they switch between shells. (as when using the «su» command, which starts a new shell process for the root account.) You may need to take extra steps, such as manually setting the «TERM» environment variable in your new shell environment.
Why doesn’t the Back key work?
It sends the «ESC» character by default. Use the Preferences panel to change this behavior:
Menu Key -> «More»-> «Preferences» -> Back button behavior
Swype soft keyboard has problems typing a lowercase ‘i’. Is there a work-around?
Several people have reported this bug. Unfortunately, I can’t reproduce it using Swype 3.25 Beta on Android 2.3.6. Maybe it’s fixed in the latest version of Swype. Please try installing Swype 3.25 or later and see if that fixes the problem.
SlideIt soft keyboard always types upper-case letters. Is there a work-around?
I have reproduced this with SlideIt version 4.0.1 on Android 2.3.6. There is a work-around, which is to tap on the «ABC» button on the upper-right-hand-corner of the SlideIt soft keyboard. This switches SlideIt into letter-at-a-time mode.
Could you make a full programmer soft keyboard with ctrl, tab, esc?
Many people report good results using the free Hacker’s Keyboard IME. Also available from Hacker’s Keyboard Download on github
Why don’t you include a telnet or ssh client?
That’s a good question! I guess I really ought to. Maybe one of these days I’ll get around to it. In the meantime, see Installing BusyBox and ssh without Rooting your Device
Could you make tab completion work?
Similar to the «Arrow Keys» question above, tab completion is the job of the shell, not the terminal emulator. The built-in Android shell prior to the Ice Cream Sandwich release does not provide tab completion. You can turn on tab completion by installing an alternate shell, such as the one that comes with Busybox.
What is Busybox?
Busybox is a collection of Linux utility programs that is designed to be run on small Linux devices, such as your Android phone.
Where can I get Busybox for my Android Phone?
Do a web search for «Android Busybox» and read through the results.
Do I need root access to install and use Busybox?
I’m building my own Android ROM, can I include Terminal Emulator for Android in my ROM?
How can I get the menu key to work with Terminal Emulator for Android on my Nook?
The Nook does not have a physical menu key. If you want Terminal Emulator for Android to work with a Nook, you will have to install a version of Android that supports soft menu keys. Android 3.0 (Honeycomb) provides support for soft menu keys.
How can I contribute a localization?
Why does Terminal Emulator for Android ask for certain permissions?
Please read the Terminal Emulator for Android Privacy Policy.
I am using Android version 4.3 or newer and I can’t get ‘su’ or ‘ping’ to work. Why?
In order to better protect ordinary users from malware, the Android OS enhanced its security model in the 4.3 and 4.4 releases.
One of the security enhancements made in Android 4.3 was to remove the ability to run setuid/setgid programs. Setuid and setgid are Linux features that enable programs to run with elevated permissions. The ping command is an example of a setuid program. Ping needs the elevated permissions in order to send and receive the special network packets used in the ping network protocol. When the ping command is run by Terminal Emulator for Android under Android 4.3 or later, the setuid/setgid feature is disabled. The ping command fails because ordinary Android applications do not have permission to send or receive the network packets used in the ping network protocol.
For similar reasons, some techniques for getting ‘su’ root access no longer work correctly on Android 4.3 and 4.4.
I don’t follow the rooting scene, so I don’t have any advice for how to work around these new security enhancements in Android 4.3 and 4.4. I guess it might be possible to create a custom ROM with a non-standard security policy, that for example allowed setuid/setgid to work again. But I don’t know if anyone’s doing that. If you’re interested I guess you need to read up on the Android ROM hacking scene. (Which I also don’t follow, so I can’t suggest which ROMs are good or not. A few years ago xda-forum and CyanogenMOD were popular, but I don’t know if that’s still the case today. Good luck!)
How do I fix «Unknown error code during application install: -505»?
This error means that there is a custom permission conflict between «Terminal Emulator for Android» and some other application that is installed on your device. Terminal Emulator for Android declares three custom permissions, and starting with Android 5.0 Lollipop, only one application at a time can be installed for any given custom permission.
The three custom permissions are:
One relatively straightforward way to figure out which applications conflict with Terminal Emulator for Android is to:
Uninstall all the apps you suspect might be using these permissions.
Install Terminal Emulator for Android.
Try to reinstall the suspected apps.
The conflicting app should fail to reinstall.
For what it is worth, some people have reported that the following application conflicts with Terminal Emulator for Android:
- jrummy ROM Toolbox Pro
So if you happen to have that app installed it might be the problem.
Hey, my bash is vulnerable to the Shellshock bug. How do I fix that?
Shellshock is a security bug in some versions of the bash shell. You can test whether your version of the bash shell is vulnerable by running this line in the terminal
If you see output like this then your version of bash is vulnerable:
Stock Android does not include the bash shell, so most Android devices do not have this bug. Some custom ROMs like CyanogenMOD 10 and 11 are reported to come with vulnerable versions of bash.
In addition, you could have manually installed your own version of bash, by for example installing a Debian chroot.
If you discover that your Android device has a vulnerable version of bash, you will need to figure out where the vulnerable version of bash comes from (either the ROM or something you installed) and then contact the vendor and ask them for a fix.
Unfortunately there’s nothing Terminal Emulator for Android can do to help (or hinder) this. It just runs whatever version of bash you have installed on your device.
Источник
What is the android terminal emulator
Copy raw contents
To keep from typing «Terminal Emulator for Android» over and over again, this document will use the abbreviation «TEA» to stand for «Terminal Emulator for Android».
Download the Software Needed to Build Terminal Emulator for Android
TEA is built using:
Telling Gradle where to find the Android NDK and SDK
Android Studio and the gradle build tool need to know where to find the NDK and SDK on your computer.
Create a file local.properties in the root directiory of the TEA project that contains this text:
On my personal dev machine the file looks like this, but of course it will be different on your machine, depending upon your OS, user name, directory tree, and version of the NDK that you have installed.
In addition, if you are building from the command line, the scripts in the «tools» directory expect the environment variable ANDROID_SDK_ROOT to be defined.
On my personal dev machine I have this line in my .profile:
Installing required SDK Packages
In order to build, in addition to a current SDK version, TEA requires the Android 3.0 (API 11) version of the Android SDK to be installed.
You can install it by running the following command-line script:
Or you can run Android Studio and choose Configure > SDK Manager, then choose the «Android 3.0 (API 11) > SDK Platform» package.
You can build TEA two ways:
- Using the Android Studio IDE
- Using the «gradlew» command line tool
Using Android Studio is convenient for development. Using «gradlew» is convenient for automated testing and publishing.
Building TEA with Android Studio
- Open Android Studio
- Choose «Open an existing Android Studio project» from the «Quick Start» wizard.
- Choose the top-level TEA directory. (If you installed the source code from github, this directory will be named Android-Terminal-Emulator).
- Use the Android Studio menu «Run : Run ‘term'» to build and run the app.
Building TEA from the command line
Make sure a file local.properties exists at the root of the TEA source tree. Android Studio will create this file automaticaly. If you don’t want to run Android Studio, you can create this file manually with the paths of your local sdk and ndk installations. For my machine that’s:
Open a command line shell window and navigate to the main TEA directory.
Источник
How to start Android Terminal Emulator as root
As usual with Linux, anything beyond simple use cases is a minor ordeal.
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:
- Install Android Terminal Emulator.
- Open the above.
- Tap the options menu icon.
- Tap Preferences.
- Scroll down to Shell.
- Tap Command line.
- Enter /system/xbin/su -c «/system/xbin/bash -» as shown below.
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.
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.
Источник