Android toolbox

From eLinux.org
Jump to: navigation, search

the 'toolbox' command in Android is a multi-function program. It encapsulates the functionality of many common Linux commands (and some special Android ones) into a single binary. This makes it more compact than having all those other commands installed individually. However, the toolbox versions of these commands (e.g. 'ps', or 'ls') have less functionality than their full-sized Linux counterparts.

Because of this, it is useful to document what features are supported by toolbox commands, versus full-features versions of these tools.

The actual toolbox binary is often located in /system/bin directory on an Android system, and the commands that it supports are listed as symlinks to /system/bin/toolbox, in this directory.

The list of commands that toolbox provides (as of Android version 4.3) is:

cat, chmod, chown, cmp, cp, ctrlaltdel, date, dd, df, dmesg, du, getevent, getprop, grep, hd, id, ifconfig, iftop, insmod, ioctl, ionice, kill, ln, log, ls, lsmod, lsof, lsusb, md5, mkdir, mount, mv, nandread, netstat, newfs_msdos, notify, printenv, ps, reboot, renice, rm, rmdir, rmmod, route, schedtop, sendevent, setconsole, setprop, sleep, smd, start, stop, sync, toolbox, top, touch, umount, uptime, vmstat watchprops, wipe

Here are details about some individual commands:

ps

Usage: ps [-t] [-x] [-P] [-p] [c] [pid] [name]

   -t show threads, comes up with threads in the list
   -x shows time, user time and system time in seconds
   -P show scheduling policy, either bg or fg are common, but also un and er for failures to get policy
   -p show priorities, niceness level
   -c show CPU (may not be available prior to Android 4.x) involved
   [pid] filter by PID if numeric, or...
   [name] ...filter by process name

top

Usage: top [ -m max_procs ] [ -n iterations ] [ -d delay ] [ -s sort_column ] [ -t ] [ -h ]

   -m num  Maximum number of processes to display.
   -n num  Updates to show before exiting.
   -d num  Seconds to wait between updates.
   -s col  Column to sort by (cpu,vss,rss,thr).
   -t      Show threads instead of processes.
   -h      Display this help screen.

vss = virtual set size = the total amount of memory allocated to this process by the CPU rss = resident set size = the amount of memory currently actually residing in main memory (vs. swap, or allocated but not actually instantiated yet), for a process.