There are questions pertaining to the use of the Android Shell or to finding a documentation of the Shell commands on Android. Since I haven't found anything convenient, I would like to use this thread to compile a list of "useful" Android commands. I am going to add commands as they are posted. A German version can be found here.

link|improve this question
4  
What defines "useful"? How will answers be bounded or evaluated? – eldarerathis Jun 30 '11 at 13:10
That could be useful for everyday use while working with the terminal. I will turn this into a Wiki as soon as the 8 hours time limit has past...ppl will figure it out than :) – n3rd Jun 30 '11 at 13:40
feedback

1 Answer

App Management

Use Android package manager pm

usage: pm [list|path|install|uninstall]
       pm list packages [-f]
       pm list permission-groups
       pm list permissions [-g] [-f] [-d] [-u] [GROUP]
       pm list instrumentation [-f] [TARGET-PACKAGE]
       pm list features
       pm path PACKAGE
       pm install [-l] [-r] [-t] [-i INSTALLER_PACKAGE_NAME] [-s] [-f] PATH
       pm uninstall [-k] PACKAGE
       pm enable PACKAGE_OR_COMPONENT
       pm disable PACKAGE_OR_COMPONENT
       pm setInstallLocation [0/auto] [1/internal] [2/external]

Examples

Install the package com.twitter.android-1.apk from the SD card

pm install /sdcard/com.twitter.android-1.apk

List installed packages that contain the term twitter

pm list packages | grep twitter

Show the install directory of the twitter package

pm path com.twitter.android

Processes

top

Lists all running processes / apps with live updates showing CPU usage, PID,...

ps

Lists all running processes / apps and allows filtering using grep

Examples

ps | grep apps

Lists all running apps on your phone

Mounting

mount -o rw,remount -t "filesystem" "Device" "Mount Point"

Allows you to remount your partitions for write access or to mount images.

Examples

Write access for the root filesystem

mount -o rw,remount -t rootfs /

Write access for your /system partition

mount -o rw,remount -t yaffs2 /dev/block/mtdblock4 /system

Write access for /system using busybox

busybox mount -o remount,rw /system

Mount the contents of myimage.img, viewable in the folder myimage

mount -o loop /sdcard/myimage.img myimage

Other

getprop can show interesting details from the device configuration, such as DNS servers, gateways, GSM details, running services, build parameters, version info etc.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.