Thursday, April 18, 2013

ADB shell command


In this article i'm going to show you more about ADB, specially the ADB shell, because this command is very interesting.

The ADB shell command allows you to run linux command from inside your android device, in this case xperia tipo smartphone.

There are two ways to run linux command via ADB, first you can type :

adb shell [the linux/unix command]

for example :

adb shell ls

Or you just type adb shell, and you will stay on the command line shell forever until you decided to exit, this way you can run any command continually.

Here's list of linux command that you can run with adb shell.
linux command example what for
ls ls show list of directory, can be use with parameter, ls -l, ls -a, ls -la
pwd pwd print working directory
cd [path] cd /system/ change directory, to go up type cd ..
cp [source] [destination] cp /system/myfile /sdcard/myfile copy file
mv [source] [destination] mv /system/myfile /sdcard/ move file
rm [filename] rm myfile remove file
touch [filename] touch myfile create file
mkdir [directory name] mkdir mydirectory make directory
rmdir [directory name] rmdir mydirectory remove directory
ping [ip address/host name] ping google.com checking specified ip address or host name is alive or not
netstat netstat show network statistics
uname uname -a show machine info (os,kernel,etc)
uptime uptime show how long your device has been on
df df show diskspace
top top show process
who am i who am i show who you are
date date show current date and time
cal cal show calendar
su su become super user
reboot reboot restart your device

Actually there is more of these commands, you can search on google if you want to know more, but note that not all linux/unix command is available via adb shell, like for example there is no ifconfig which very popular on linux operating system for setup ip address.

good luck.

No comments:

Post a Comment