The Command Line Interface (CLI) is the counterpoint to the Graphical User Interface (GUI). While graphical user interfaces make easy tasks easy, command line interfaces make difficult tasks possible.

This list applies to Android only.

CLI Commands

Support Level

Function

am get-config

full

Gather configuration data from a device.

cd

full

Change directory.

getprop

full

Get property via the android property service.

getprop ro.build.version.sdk

full

Get API level device properties.

ip -f inet addr show wlan0

full

Show WiFi IP address.

logcat

full

Prints log data to the screen.

logcat *:D

partial

Prints log data to the screen, filter to only show debug level.

In few devices, this command cannot be aborted

logcat *:E

partial

Prints log data to the screen, filter to only show error level.

In few devices, this command cannot be aborted

logcat *:I

partial

Prints log data to the screen, filter to only show info level.

In few devices, this command cannot be aborted

logcat *:V

partial

Prints log data to the screen, filter to only show verbose level.

In few devices, this command cannot be aborted

logcat *:W

partial

Prints log data to the screen, filter to only show warning level.

In few devices, this command cannot be aborted

ls

full

List directory contents.

ls -a

full

List directory contents, do not hide entries starting with a dot.

ls -n

full

List directory contents, list numeric UIDs and GIDs.

ls -R

full

List directory contents, list subdirectories recursively.

ls -s

full

List directory contents, print size of each file, in blocks.

mkdir

full

Make directory

netcfg / ifconfig

full

Configure and manage network connections via profiles.

netstat

full

Network statistics.

ping

partial

Test the connection and latency between two network connection.

In few devices, this command cannot be aborted

pm list packages

full

Prints all packages, optionally only those whose package name contains the text in <FILTER>.

pm list packages -3

full

Prints all packages filtered to only show third party packages.

pm list packages -d

full

Prints all packages filtered to only show disabled packages.

pm list packages -e

full

Prints all packages filtered to only show enabled packages.

pm list packages -f

full

Prints all packages including their associated file.

pm list packages -i

full

See the installer for the packages.

pm list packages -s

full

Prints all packages filtered to only show system packages.

pm list packages -u

full

Prints all packages including uninstalled packages.

pm list permission-groups

full

Lists all permissions groups.

pm list permissions

full

Lists all permissions on the device.

pm path <package>

full

Print the path to the APK of the given <package>.

ps

full

Print process status.

ps -p

full

Print process status and show scheduling policy.

pwd

full

Print current working directory location.

rm -d

full

Remove directory, even if it is not empty.

rm -f

full

Remove directory, force remove without prompt.

rm -r

full

Remove the contents of the directory recursively.

top

partial

Display top CPU processes.

In few devices, this command cannot be aborted

touch

full

Create empty file or change file timestamps