Connect Your Android Device and Launch A Command Line Window in Advance
Connect Your Android Device and Launch A Command Line Window in Advance
Then you can try to use all these commands by executing command adb shell.
Commands Desc.
am Activity Manager
Help Options:
-?, --help Show help options
bluetoothd
Application Options:
-d, --debug=DEBUG Specify debug options to enable
-p, --plugin=NAME,.., Specify plugins to load
-P, --noplugin=NAME,... Specify plugins not to load
-n, --nodetach Don't run as daemon in background
-v, --version Show version information and exit
-u, --udev Run from udev mode of operation
bmgr is a shell tool you can use to interact with the Backup Manager on Android devices.
usage: bmgr [backup|restore|list|transport|run]
bmgr backup PACKAGE
bmgr enable BOOL
bmgr enabled
bmgr list transports
bmgr bmgr list sets
bmgr transport WHICH
bmgr restore TOKEN
bmgr restore TOKEN PACKAGE...
bmgr restore PACKAGE
bmgr run
bmgr wipe PACKAGE
Backup
Options:
-apk, Save APK
-noapk, Save no APK
bu -shared, Save Shared
-noshared, Save no Shared
-system, All Includes System
-nosystem, Not all Includes System
-all, Everything
bugreport Export all the debug message from Android and Linux layer.
cat -> toolbox Concatenate, a tool to print out the content of a file continually. It's the same usage with Linux.
chmod -> toolbox Change the mode of file. Usage is the same with Linux.
chown -> toolbox Change the owner of a file/folder. Usage is the same with Linux.
cmp -> toolbox Compare the file. Usage is the same with Linux.
usage: adb shell content delete --uri --bind [--bind ...] [--where ]
Example:
# Remove "new_setting" secure setting.
adb shell content delete --uri content://settings/secure --where "name='new_setting'"
The getevent tool runs on the device and provides information about input devices and a live dump of kernel input events.
Usage: getevent [-t] [-n] [-s switchmask] [-S] [-v [mask]] [-d] [-p] [-i] [-l] [-q] [-c count] [-r]
[device]
-t: show time stamps
-n: don't print newlines
-s: print switch states for given bits
-S: print all switch states
-v: verbosity mask (errs=1, dev=2, name=4, info=8, vers=16, pos. events=32, props=64)
getevent -> toolbox
-d: show HID descriptor, if available
-p: show possible events (errs, dev, name, pos. events)
-i: show all device info and possible events
-l: label event types and names in plain text
-q: quiet (clear verbosity mask)
-c: print given number of events then exit
-r: print rate events are received
http://source.android.com/tech/input/getevent.html
TCP/IP command. Assign an address to a network interface and/or configure network interface parameters. ifconfig is typically used at boot time to define
ifconfig -> toolbox
the network address of each interface on a machine.
Create pseudonyms (links) for files, allowing them to be accessed by different names.
ln -> toolbox
ln [-s]
lsof -> toolbox List information in /Proc folder which contains all the process information.
monkey A automation stress test tool which generates random event for Android device.
Remove a file.
mv -> toolbox
USAGE: mv
printenv -> toolbox Print Environment Variables and their Values for Android Device
Remove a module
rmmod -> toolbox
usage: rmmod
Send a event trigger to specified device with type, code, and value. E.g. Touch, or Key.
sendevent -> toolbox
Usage: sendevent [device] [type] [code] [value].
Service operation
Usage: service [-h|-?]
service list
service check SERVICE
service
service call SERVICE CODE [i32 INT | s16 STR] ...
Options:
i32: Write the integer INT into the send parcel.
s16: Write the UTF-16 string STR into the send parcel.
Copy host->device only if changed. adb sync is a tool which may be used to copy files from the computer to the device if the files has been changed. By
default the command will synchronize /data and /system unless one option is specified. For the command to operate properly a system variable must be
sync -> toolbox created and defined. ANDROID_PRODUCT_OUT must designate the full actual path to the directory containing a file structure with system and/or data
subfolders containing the files and folders changed.
Usage: sync [ ]
uptime -> toolbox The up time since last boot. The information includes up, idle, and sleep time.
vold Manage the device on Android. The function is similar with udev in Linux.
watchprops -> toolbox Monitor the change of property and list them. The properties can be viewed by executing getprop and set by executing setprop.
Configure WLAN
usage:
wpa_supplicant wpa_supplicant [-BddhKLqqstuvW] [-P] [-g] \
-i -c [-C] [-D] [-p] \
[-b] [-f] [-e] \
[-o] [-O] \
[-N -i -c [-C] [-D] \
[-p] [-b] ...]
drivers:
nl80211 = Linux nl80211/cfg80211
options:
-b = optional bridge interface name
-B = run daemon in the background
-c = Configuration file
-C = ctrl_interface parameter (only used if -c is not)
-i = interface name
-d = increase debugging verbosity (-dd even more)
-D = driver name (can be multiple drivers: nl80211,wext)
-e = entropy file
-g = global ctrl_interface
-K = include keys (passwords, etc.) in debug output
-t = include timestamp in debug messages
-h = show this help text
-L = show license (GPL and BSD)
-o = override driver parameter for new interfaces
-O = override ctrl_interface parameter for new interfaces
-p = driver parameters
-P = PID file
-q = decrease debugging verbosity (-qq even less)
-v = show version
-W = wait for a control interface monitor before starting
-N = start describing new interface
example:
wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf