In previous post we were looking at various command-line tools that come up with Android SDK (android, emulator, adb). We mentioned that abd shell command provides a shell access to Android device. Let’s explore this further.
But before we start on this, let’s talk a bit about what Android OS is.
A good short history of Android OS can be found here. If you read the article, you’ll find that Android OS is actually modified stripped down Linux + certain additional native libraries + Dalvik JVM which runs “customer facing” applications written in Java. Just a bit more facts:
- Android OS 1.6, 2.0. 2.1 are based on Linux Kernel 2.6.29
- Android OS 2.2 is based on Linux Kernel 2.6.32
- Android OS 2.3 is based on Linux 2.6.35
Which means Ubuntu Linux 10.4 Natty Narwhal and running on my laptop and Android 2.3 are sort of sisters since they share the same Linux Kernel 2.6.35. Interesting…
The shell used by Android is actually Unix ash shell. It is somewhat stripped down, so such commands like grep are not available, but it still has around 100 commands which is very impressive. You can check what commands are available:
adb shell ls /system/bin
More on adb and shell commands can be found here.
You can look at certain examples of shell usage here. Don’t try them on a real device unless you fully understand what you are doing!
It is no surprise that certain developers started porting Linux applications to Android. For example look here for how to add bash shell to Android OS.
I will be not surprised to find ports of bigger Linux applications to Android. For example, Gnome is already allegedly running on Android. But why to be surprised…. Android devices have more CPU power and pixels on screens that best PCs had 10-15 years ago, right?