I want to run terminal on my device however the small screen is very inconvenient. I wondering if it is possible to run terminal on real android device from PC?
You can use Android Debug Bridge (ADB) shell to issue basic Linux commands on your phone, just like you would in a terminal emulator app. To install you'll need to do the following:
- On the phone go to
Settings -> About phone, and tap on "Build number" seven times. This enabled Developer tools.
- Go back to the main Settings screen and you should now see
Developer optionsunder the "System" section.
- Go to
Developer options, enable "Android debugging" option, and then tap
OKon the verification prompt.
- On your PC download the Android SDK Tools from here. You can either download the whole SDK, or just the stuff necessary to connect to your phone, which is on the same page, under "Download for other platforms -> SDK Tools Only" section.
- Install the tools you just downloaded.
- Download and install the USB drivers for your phone (usually provided by the manufacturer.)
- Re-connect your phone to the PC with a USB cable.
- Open Command prompt (assuming Windows,) navigate to where you installed the SDK tools (e.g. "C:\android-sdk\platform-tools\") and type in the following:
- If all of the above was done successfully, a prompt should pop up asking you to allow connections from this computer. Accept the pairing request, and the prompt should show your phone's ID. If this doesn't happen - it usually means that the drivers aren't installed correctly.
- Back at Command prompt, type in
adb shelland press Enter, and you should be connected to the phone's terminal.
This should get you started. ADB commands are listed on Google's site here. The shell provides some basic Linux commands like
cp, etc. Be aware that most file and device management commands will require root (i.e. elevated privileges,) which is a separate topic.
Alternatively to the ADB variant described by Chahk (which requires at least a minal installation of ADB on your computer), you can install a SSH server app on your device (examples include, but are not restricted to, SSH Server, DigiSSHD, Servers Ultimate). Then you can use the
ssh command on Linux/Mac, or a tool like PuTTY on Windows, to connect to your device and run shell commands, as if you were using a terminal app on the device itself.
You will need
Your Android phone ( Rooted and with Wi-Fi functionality ) SSHDroid (SSH server) PuTTY.exe (SSH client)
Install “SSHDroid” from android market to your phone this will turn your phone into a SSH server For the first time you need to set-up a password to log-in shell. Default password is admin which may you have to change on first time
Download PuTTY.exe for SSH Client on your windows PC, it comes in single executable file so you don’t need to install that just double click on that and PuTTY will start. There is no need to setting up any thing in PuTTY.
First step is to running Wi-Fi and connect your android phone to target PC, then run SSHDroid server into your mobile phone, but before that make sure under the SSHDroid’s application window click Options -> “Require WiFi” is checked as seen on above pic screen 2. And then click “start” option. Once SSH server is successfully started it will show IP address of your mobile phone in light sky color like this firstname.lastname@example.org as seen on screen 4. Take the IP “192.168.43.129” and type it to your PuTTY program’s (PC) host field and hit connect. Make sure port number is 22 as seen in second pic. It will ask for certification click ok and then command line log-in window will appear, type “root” hit enter and then type the password for root user, default is “admin” as i mentioned before. After successful log-in you will be able to use Linux commands like ls, reboot -f, mkdir, find, etc.
if your phone is connected to internet you can also use network commands like ping, wget, telnet etc.