{"id":1836,"date":"2013-04-22T03:04:31","date_gmt":"2013-04-22T03:04:31","guid":{"rendered":"https:\/\/blogzamana.com\/?p=1836"},"modified":"2013-06-14T02:40:10","modified_gmt":"2013-06-14T02:40:10","slug":"shelling-your-android","status":"publish","type":"post","link":"https:\/\/blogzamana.com\/shelling-your-android\/","title":{"rendered":"Shelling Your Android!"},"content":{"rendered":"
<\/a><\/p>\n For all android pros out there those who want to make their way through the bot. Don\u2019t you think a terminal would be a good piece to start. Yep, I too agree with you. The flexibility a shell provides is not comparable to any GUI system in the computing world. Using a shell, you can control virtually everything of an operating system which might be possible on the GUI or might be some hidden easter eggs. In fact, a shell is an integral part of every operating system. From the good old days of VT100 terminals, shells have been a standard and still continues to exist on many popular operating systems with sophisticated user interfaces and is used internally for performing all kinds of tasks. And android is no exception. Being a descendant of Linux, Android packs a shell similar to its parent \u2013 the UNIX shell. In this post, I\u2019m gonna show you how to get started with your shell.<\/p>\n There are two ways to get a shell.<\/p>\n This shell exists as a part of the Android Debug Bridge (adb) and can be accessed by issuing the command: The Android platform has also got many terminal emulators that emulate the standard VT100 terminal. Such an emulator is common on *NIX devices. It\u2019s easy to use, portable as well as installs on the device itself. You no longer need a PC for shelling instead, you can even shell on the move. But sometimes some terminal utilities require you to root your device<\/a>. If you like to get one you can get this very popular Terminal Emulator from the Play Store<\/a>.<\/li>\n<\/ol>\n Once you have got a shell for yourselves, let us explore it to unlock its potential. Firstly, a word to know about the Android Shell (ash). The Android shell is more or less like the popular GNU bash shell (Bourne\u2013Again Shell) or more appropriately the classic UNIX sh (shell) shell. Yes, for users from a DOS\u2013like background, this is NOTHING LIKE A DOS SHELL. Don\u2019t try to run DOS commands. They would behave strangely or simply won\u2019t work. For example, in UNIX environments the type command lists the full path of an executable; whereas in DOS, it dumps the contents of the file referred. The UNIX equivalent is cat. If you are from a POSIX background, you will be right at home with this shell. Another point to DOS users, all UNIX shell are case\u2013sensitive. Cat is not equivalent to CAT (no command exists!). As a convention, commands are always present in lower case.<\/p>\n Some popular commands are:<\/p>\n This list is not complete. There are more commands available in your device. To know many possible commands you can list the directories in system PATH using the ls command.<\/p>\n Some of the common ones are :<\/p>\n Note: The exact directories varies from device to device. You can echo the $PATH variable to know what directories are included. For some more set of *NIX like commands not included in Android, you can get the BusyBox suite for Android<\/strong>. Unfortunately, it requires you to root your device.<\/p>\n The Android commands are similar to Linux, UNIX or Mac commands (POSIX). The documentation for any will work for another. The simplest way is to Google for man <command>. And if you have access to a Linux, UNIX or Mac system, fire up a shell and type man <command> to get a detailed documentation about the command too. A thing to note, you will need to use your wisdom, since such documentation is customized to meet the usage of desktops. Here is some documentation about android specific on the Android developers site.<\/p>\n Stay tuned to BlogZamana for more exciting Android tips and tricks. Enjoy Shelling!<\/p>\n","protected":false},"excerpt":{"rendered":" For all android pros out there those who want to make their way through the bot. Don\u2019t you think a terminal would be a good piece to start. Yep, I too agree with you. The flexibility a shell provides is not comparable to any GUI system in the computing world. Using a shell, you can […]<\/p>\n","protected":false},"author":6,"featured_media":1837,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"yoast_head":"\nGetting a shell<\/h4>\n
\n
Using the one that comes with Android SDK.<\/b><\/h5>\n
\nadb shell<\/strong>
\nAlong with the shell, the Android Debug Bridge also comes with a host of other utilities and functionalities too. Such a discussion is beyond the scope of this article. As far as my preferences are considered, adb shell is my preferred way of shelling my device. The main advantage is it doesn\u2019t require me to root my device as I hate fiddling with my system. However, the only inconvenience is you need to connect your device to the PC (with USB debugging or remote debugging). Deal with the driver mess (only on Windows; no issues on Linux and Macs, yay!) Setup debugging. Connect adb with an intricate serial number and so on. To get the tools head over to Android SDK Tools from the Android Developers Website .<\/li>\nGetting a terminal emulator.<\/b><\/h5>\n
Exploring the shell<\/h4>\n
\n
\n
\nRun :
\necho $PATH<\/strong>
\nto list the directories included in your PATH.<\/p>\nDetailed documentation on commands<\/h4>\n