2018-12-05 21:08:32 +00:00
|
|
|
# Android's shell and utilities
|
2017-04-14 23:21:01 +00:00
|
|
|
|
|
|
|
Since IceCreamSandwich Android has used
|
|
|
|
[mksh](https://www.mirbsd.org/mksh.htm) as its shell. Before then it used
|
|
|
|
[ash](https://en.wikipedia.org/wiki/Almquist_shell) (which actually
|
2017-09-12 22:51:12 +00:00
|
|
|
remained unused in the tree up to and including KitKat).
|
2017-04-14 23:21:01 +00:00
|
|
|
|
2017-09-12 22:51:12 +00:00
|
|
|
Initially Android had a very limited command-line provided by its own
|
|
|
|
"toolbox" binary. Since Marshmallow almost everything is supplied by
|
2017-04-14 23:21:01 +00:00
|
|
|
[toybox](http://landley.net/toybox/) instead.
|
|
|
|
|
|
|
|
We started moving a few of the more important tools to full
|
2017-09-12 22:51:12 +00:00
|
|
|
BSD implementations in JellyBean, and continued this work in
|
2017-04-14 23:21:01 +00:00
|
|
|
Lollipop. Lollipop was a major break with the past in many ways (LP64
|
|
|
|
support and the switch to ART both having lots of knock-on effects around
|
|
|
|
the system), so although this was the beginning of the end of toolbox it
|
|
|
|
(a) didn't stand out given all the other systems-level changes and (b)
|
|
|
|
in Marshmallow we changed direction and started the move to toybox.
|
|
|
|
|
2018-06-08 16:29:07 +00:00
|
|
|
Not everything is provided by toybox, though. For the bzip2 command-line tools
|
|
|
|
we use the ones that are part of the bzip2 distribution. The awk added in
|
|
|
|
Android P is Brian Kernighan's "one true" awk.
|
2017-09-12 22:51:12 +00:00
|
|
|
|
2017-04-14 23:21:01 +00:00
|
|
|
The lists below show what tools were provided and where they came from in
|
|
|
|
each release starting with Gingerbread. This doesn't tell the full story,
|
|
|
|
because the toolbox implementations did have bugs fixed and options added
|
|
|
|
over the years. Gingerbread's rm, for example, supported `-r`/`-R` but not
|
|
|
|
`-f`. But this gives you an idea of what was available in any given release,
|
|
|
|
and how usable it was likely to be.
|
|
|
|
|
2017-09-12 22:51:12 +00:00
|
|
|
Also note that in any given release `toybox` probably contains more
|
|
|
|
commands than there are symlinks for in `/system/bin`. You can get the
|
|
|
|
full list for a release by running `toybox` directly.
|
|
|
|
|
2017-04-14 23:21:01 +00:00
|
|
|
|
2018-12-05 21:08:32 +00:00
|
|
|
## Android 2.3 (Gingerbread)
|
2017-04-14 23:21:01 +00:00
|
|
|
|
|
|
|
BSD: cat dd newfs\_msdos
|
|
|
|
|
|
|
|
toolbox: chmod chown cmp date df dmesg getevent getprop hd id ifconfig
|
|
|
|
iftop insmod ioctl ionice kill ln log ls lsmod lsof mkdir mount mv
|
|
|
|
nandread netstat notify printenv ps reboot renice rm rmdir rmmod route
|
|
|
|
schedtop sendevent setconsole setprop sleep smd start stop sync top
|
|
|
|
umount uptime vmstat watchprops wipe
|
|
|
|
|
|
|
|
|
2018-12-05 21:08:32 +00:00
|
|
|
## Android 4.0 (IceCreamSandwich)
|
2017-04-14 23:21:01 +00:00
|
|
|
|
|
|
|
BSD: cat dd newfs\_msdos
|
|
|
|
|
|
|
|
toolbox: chmod chown cmp date df dmesg getevent getprop hd id ifconfig
|
|
|
|
iftop insmod ioctl ionice kill ln log ls lsmod lsof mkdir mount mv
|
|
|
|
nandread netstat notify printenv ps reboot renice rm rmdir rmmod route
|
|
|
|
schedtop sendevent setconsole setprop sleep smd start stop sync top
|
|
|
|
touch umount uptime vmstat watchprops wipe
|
|
|
|
|
|
|
|
|
2018-12-05 21:08:32 +00:00
|
|
|
## Android 4.1-4.3 (JellyBean)
|
2017-04-14 23:21:01 +00:00
|
|
|
|
|
|
|
BSD: cat cp dd du grep newfs\_msdos
|
|
|
|
|
|
|
|
toolbox: chcon chmod chown clear cmp date df dmesg getenforce getevent
|
|
|
|
getprop getsebool hd id ifconfig iftop insmod ioctl ionice kill ln
|
|
|
|
load\_policy log ls lsmod lsof md5 mkdir mount mv nandread netstat notify
|
|
|
|
printenv ps reboot renice restorecon rm rmdir rmmod route runcon schedtop
|
|
|
|
sendevent setconsole setenforce setprop setsebool sleep smd start stop
|
|
|
|
sync top touch umount uptime vmstat watchprops wipe
|
|
|
|
|
|
|
|
|
2018-12-05 21:08:32 +00:00
|
|
|
## Android 4.4 (KitKat)
|
2017-04-14 23:21:01 +00:00
|
|
|
|
|
|
|
BSD: cat cp dd du grep newfs\_msdos
|
|
|
|
|
|
|
|
toolbox: chcon chmod chown clear cmp date df dmesg getenforce getevent
|
|
|
|
getprop getsebool hd id ifconfig iftop insmod ioctl ionice kill ln
|
|
|
|
load\_policy log ls lsmod lsof md5 mkdir mkswap mount mv nandread netstat
|
|
|
|
notify printenv ps readlink renice restorecon rm rmdir rmmod route runcon
|
|
|
|
schedtop sendevent setconsole setenforce setprop setsebool sleep smd start
|
|
|
|
stop swapoff swapon sync top touch umount uptime vmstat watchprops wipe
|
|
|
|
|
|
|
|
|
2018-12-05 21:08:32 +00:00
|
|
|
## Android 5.0 (Lollipop)
|
2017-04-14 23:21:01 +00:00
|
|
|
|
|
|
|
BSD: cat chown cp dd du grep kill ln mv printenv rm rmdir sleep sync
|
|
|
|
|
|
|
|
toolbox: chcon chmod clear cmp date df dmesg getenforce getevent getprop
|
|
|
|
getsebool hd id ifconfig iftop insmod ioctl ionice load\_policy log ls
|
|
|
|
lsmod lsof md5 mkdir mknod mkswap mount nandread netstat newfs\_msdos
|
|
|
|
nohup notify ps readlink renice restorecon rmmod route runcon schedtop
|
|
|
|
sendevent setenforce setprop setsebool smd start stop swapoff swapon
|
|
|
|
top touch umount uptime vmstat watchprops wipe
|
|
|
|
|
|
|
|
|
2018-12-05 21:08:32 +00:00
|
|
|
## Android 6.0 (Marshmallow)
|
2017-04-14 23:21:01 +00:00
|
|
|
|
|
|
|
BSD: dd du grep
|
|
|
|
|
|
|
|
toolbox: df getevent iftop ioctl ionice log ls lsof mount nandread
|
|
|
|
newfs\_msdos ps prlimit renice sendevent start stop top uptime watchprops
|
|
|
|
|
|
|
|
toybox: acpi basename blockdev bzcat cal cat chcon chgrp chmod chown
|
|
|
|
chroot cksum clear comm cmp cp cpio cut date dirname dmesg dos2unix echo
|
|
|
|
env expand expr fallocate false find free getenforce getprop groups
|
|
|
|
head hostname hwclock id ifconfig inotifyd insmod kill load\_policy ln
|
|
|
|
logname losetup lsmod lsusb md5sum mkdir mknod mkswap mktemp modinfo
|
|
|
|
more mountpoint mv netstat nice nl nohup od paste patch pgrep pidof
|
|
|
|
pkill pmap printenv printf pwd readlink realpath restorecon rm rmdir
|
|
|
|
rmmod route runcon sed seq setenforce setprop setsid sha1sum sleep sort
|
|
|
|
split stat strings swapoff swapon sync sysctl tac tail tar taskset tee
|
|
|
|
time timeout touch tr true truncate umount uname uniq unix2dos usleep
|
|
|
|
vmstat wc which whoami xargs yes
|
|
|
|
|
|
|
|
|
2018-12-05 21:08:32 +00:00
|
|
|
## Android 7.0 (Nougat)
|
2017-04-14 23:21:01 +00:00
|
|
|
|
|
|
|
BSD: dd grep
|
|
|
|
|
|
|
|
toolbox: getevent iftop ioctl log nandread newfs\_msdos ps prlimit
|
|
|
|
sendevent start stop top
|
|
|
|
|
|
|
|
toybox: acpi base64 basename blockdev bzcat cal cat chcon chgrp chmod
|
|
|
|
chown chroot cksum clear comm cmp cp cpio cut date df dirname dmesg
|
|
|
|
dos2unix du echo env expand expr fallocate false find flock free
|
|
|
|
getenforce getprop groups head hostname hwclock id ifconfig inotifyd
|
|
|
|
insmod ionice iorenice kill killall load\_policy ln logname losetup ls
|
|
|
|
lsmod lsof lsusb md5sum mkdir mknod mkswap mktemp modinfo more mount
|
|
|
|
mountpoint mv netstat nice nl nohup od paste patch pgrep pidof pkill
|
|
|
|
pmap printenv printf pwd readlink realpath renice restorecon rm rmdir
|
|
|
|
rmmod route runcon sed seq setenforce setprop setsid sha1sum sleep sort
|
|
|
|
split stat strings swapoff swapon sync sysctl tac tail tar taskset tee
|
|
|
|
time timeout touch tr true truncate tty ulimit umount uname uniq unix2dos
|
|
|
|
uptime usleep vmstat wc which whoami xargs xxd yes
|
|
|
|
|
|
|
|
|
2018-12-05 21:08:32 +00:00
|
|
|
## Android 8.0 (Oreo)
|
2017-04-14 23:21:01 +00:00
|
|
|
|
|
|
|
BSD: dd grep
|
|
|
|
|
|
|
|
bzip2: bzcat bzip2 bunzip2
|
|
|
|
|
2017-09-12 22:51:12 +00:00
|
|
|
toolbox: getevent newfs\_msdos
|
2017-04-14 23:21:01 +00:00
|
|
|
|
|
|
|
toybox: acpi base64 basename blockdev cal cat chcon chgrp chmod chown
|
|
|
|
chroot chrt cksum clear cmp comm cp cpio cut date df diff dirname dmesg
|
|
|
|
dos2unix du echo env expand expr fallocate false file find flock free
|
2017-09-12 22:51:12 +00:00
|
|
|
getenforce getprop groups gunzip gzip head hostname hwclock id ifconfig
|
|
|
|
inotifyd insmod ionice iorenice kill killall ln load\_policy log logname
|
|
|
|
losetup ls lsmod lsof lspci lsusb md5sum microcom mkdir mkfifo mknod
|
|
|
|
mkswap mktemp modinfo modprobe more mount mountpoint mv netstat nice
|
|
|
|
nl nohup od paste patch pgrep pidof pkill pmap printenv printf ps pwd
|
|
|
|
readlink realpath renice restorecon rm rmdir rmmod runcon sed sendevent
|
|
|
|
seq setenforce setprop setsid sha1sum sha224sum sha256sum sha384sum
|
|
|
|
sha512sum sleep sort split start stat stop strings swapoff swapon sync
|
|
|
|
sysctl tac tail tar taskset tee time timeout top touch tr true truncate
|
|
|
|
tty ulimit umount uname uniq unix2dos uptime usleep uudecode uuencode
|
|
|
|
vmstat wc which whoami xargs xxd yes zcat
|
2017-12-04 06:12:38 +00:00
|
|
|
|
2018-12-05 21:08:32 +00:00
|
|
|
|
|
|
|
## Android 9.0 (Pie)
|
2017-12-04 06:12:38 +00:00
|
|
|
|
|
|
|
BSD: dd grep
|
|
|
|
|
|
|
|
bzip2: bzcat bzip2 bunzip2
|
|
|
|
|
|
|
|
one-true-awk: awk
|
|
|
|
|
2018-01-02 19:50:16 +00:00
|
|
|
toolbox: getevent getprop newfs\_msdos
|
2017-12-04 06:12:38 +00:00
|
|
|
|
|
|
|
toybox: acpi base64 basename blockdev cal cat chcon chgrp chmod chown
|
|
|
|
chroot chrt cksum clear cmp comm cp cpio cut date df diff dirname dmesg
|
2018-05-03 18:02:07 +00:00
|
|
|
dos2unix du echo env expand expr fallocate false file find flock fmt free
|
2018-01-02 19:50:16 +00:00
|
|
|
getenforce groups gunzip gzip head hostname hwclock id ifconfig inotifyd
|
2018-05-03 18:02:07 +00:00
|
|
|
insmod ionice iorenice kill killall ln load\_policy log logname losetup ls
|
|
|
|
lsmod lsof lspci lsusb md5sum microcom mkdir mkfifo mknod mkswap mktemp
|
|
|
|
modinfo modprobe more mount mountpoint mv netstat nice nl nohup od paste
|
|
|
|
patch pgrep pidof pkill pmap printenv printf ps pwd readlink realpath
|
|
|
|
renice restorecon rm rmdir rmmod runcon sed sendevent seq setenforce
|
|
|
|
setprop setsid sha1sum sha224sum sha256sum sha384sum sha512sum sleep
|
|
|
|
sort split start stat stop strings stty swapoff swapon sync sysctl tac
|
|
|
|
tail tar taskset tee time timeout top touch tr true truncate tty ulimit
|
|
|
|
umount uname uniq unix2dos uptime usleep uudecode uuencode vmstat wc
|
|
|
|
which whoami xargs xxd yes zcat
|
2018-04-21 17:49:17 +00:00
|
|
|
|
2018-12-05 21:08:32 +00:00
|
|
|
|
|
|
|
## Android Q
|
2018-04-21 17:49:17 +00:00
|
|
|
|
2018-07-26 21:43:31 +00:00
|
|
|
BSD: grep fsck\_msdos newfs\_msdos
|
2018-06-20 22:48:28 +00:00
|
|
|
|
2018-04-21 17:49:17 +00:00
|
|
|
bzip2: bzcat bzip2 bunzip2
|
|
|
|
|
|
|
|
one-true-awk: awk
|
|
|
|
|
2018-06-20 22:48:28 +00:00
|
|
|
toolbox: getevent getprop
|
2018-04-21 17:49:17 +00:00
|
|
|
|
2018-12-05 21:08:32 +00:00
|
|
|
toybox: acpi base64 basename bc blkid blockdev cal cat chattr chcon chgrp
|
|
|
|
chmod chown chroot chrt cksum clear cmp comm cp cpio cut date dd df
|
|
|
|
diff dirname dmesg dos2unix du echo egrep env expand expr fallocate
|
|
|
|
false fgrep file find flock fmt free freeramdisk fsfreeze getconf
|
|
|
|
getenforce getfattr grep groups gunzip gzip head help hostname hwclock
|
|
|
|
i2cdetect i2cdump i2cget i2cset iconv id ifconfig inotifyd insmod
|
|
|
|
install ionice iorenice iotop kill killall ln load\_policy log logname
|
|
|
|
losetup ls lsattr lsmod lsof lspci lsusb makedevs md5sum microcom
|
|
|
|
mkdir mkfifo mknod mkswap mktemp modinfo modprobe more mount mountpoint
|
|
|
|
mv nbd-client nc netcat netstat nice nl nohup nproc nsenter od partprobe
|
|
|
|
paste patch pgrep pidof ping ping6 pivot\_root pkill pmap printenv
|
|
|
|
printf prlimit ps pwd pwdx readlink realpath renice restorecon rev
|
|
|
|
rfkill rm rmdir rmmod runcon sed sendevent seq setenforce setfattr
|
|
|
|
setprop setsid sha1sum sha224sum sha256sum sha384sum sha512sum sleep
|
|
|
|
sort split start stat stop strings stty swapoff swapon sync sysctl
|
|
|
|
tac tail tar taskset tee time timeout top touch tr traceroute traceroute6
|
|
|
|
true truncate tty tunctl ulimit umount uname uniq unix2dos unlink
|
|
|
|
unshare uptime usleep uudecode uuencode uuidgen vconfig vmstat watch
|
|
|
|
wc which whoami xargs xxd yes zcat
|