Android terminal emulator commands

Android terminal emulator commands

0 1546

Guide:Using the Terminal

In this wiki, a lot of actions have to be preformed in the console. There are GUI alternatives for the commands, but often it is harder to describe a GUI sequence (a lot of screen shots). In some cases, no applications has been written that can do the same. Every Android device has a console. There are a couple of ways to talk to the console, on the phone via an terminal emulator, via adb shell over an usb cable or over wifi using sshd.
Contents

1 Different methods
1.1 Terminal Emulator
1.2 ADB Shell (link)
1.3 SSHD
2 Useful commands
2.1 Root Access
2.2 Change directory
2.3 List all files
2.4 Mount
2.5 Move, Copy and Remove
2.6 Reboot
3 Links

Different methods
Terminal Emulator

In the market, find Terminal Emulator and install. Now you can access the Android shell using on the phone itself. Start the application and type

$ su
#

Assuming you have rooted your phone, you now have full control!
ADB Shell (link)

To install and use the ADB tool:

Download and install the Android SDK from http://developer.android.com/sdk/index.html
The adb executable is included in this package in the tools directory
Setup your OS to recognize the moment and use it with adb
Windows
Make sure to keep adb.exe in the folder it was extracted in (there is a .dll it needs in order to operate properly)
Make sure the Samsung Moment USB drivers are installed properly.
Run command prompt.
Go to the directory where adb has been extracted. (ie: cd program files/etc/etc/android-sdk*/tools/)
type ‘adb shell’, hit enter.
Linux
Create a file in /etc/udev/rules.d call 50-android.rules
Edit the file and make it look like:

SUBSYSTEM==”usb”, ATTR{idVendor}==”04e8″, MODE=”0666″

You will probably need to restart udev…this is distro dependant usually

For example on ubuntu: sudo restart udev

Start the adb server by running adb start-server
In some cases you may have to start the server as root by doing sudo adb start-server. This may be remidied by modifying the above file to something like SUBSYSTEM==”usb”, ATTR{idVendor}==”04e8″, MODE=”0666″, OWNER=”username” where username is your user name (although this did not help in my situation…)
Run ‘adb devices’ and check to see if your device is listed

How to use ADB, along with the command listing – http://developer.android.com/guide/developing/tools/adb.html
SSHD

Install any sshd server into your device. I’m using SSHDroid (available on the market), but can use anything else.
Configure it to allow sshd server without wifi.
On your computer, use ABD to forward port: in command shell execute:

abd.exe forward tcp:2222 tcp:22

Now you can connect to your device from your computer with your favorite ssh client using ‘localhost:2222’. I’m using putty.

Avantage:
With putty, you have a very good console:

Arrow keys and history work fine.
You can copy/paste with mouse
Completion with works fine.

NO COMMENTS

Leave a Reply