You are on page 1of 1

Android Debug Bridge File operations Common actions

Cheat Sheet adb push <local> <remote> Copy file/dir to device. To open the URL:
adb pull <remote> [<local>] Copy file/dir from device. $ am start -a android.intent.action.VIEW -d URL
adb backup -f <file> [<packages...>]
Selecting a device Backup the phone. Logs
If you want to access the private package files just use
adb devices List of devices All logs are accessed by using either
run-as <package> cat <file>.
by serial number. $ logcat [options] [filter] [filter] . . .
adb devices -l List of devices or
Paths
by product/model. adb logcat [options] [filter] [filter] . . .
/data/data/<package> App data, as described below.
adb -s <serial> ... Command line selection.
databases/ App databases. Useful options are:
export ANDROID_SERIAL=<serial> Env. variable selection.
shared prefs/ Shared preferences. -d Only dump logs (do not block).
If a command starts with $ it has to be run from the Android /data/app APK files installed by user. -c Flush the buffers.
shell or via adb shell <command>, or even better /system/app Pre-installed APK files. -b <buffer> Buffer to display (default: system, main).
adb shell <command> | less. /mnt/asec Encrypted apps (App2SD). <tag>[:priority] filter spec at the end of command.
/mnt/emmc Internal SD Card.
/mnt/sdcard External/Internal SD Card. Available priorities are:
Package installation /mnt/sdcard/external sd External SD Card. V Verbose
D Debug
adb install <apk> Installs app. I Info
Phone info
$ pm install <path> Install app from phone path. W Warn
$ pm install -r <path> Reinstall app from phone path. $ sqlite3 /data/data/ E Error
$ pm uninstall <name> Remove the app. com.android.providers.settings/ F Fatal
$ pm get-install-location Install location: databases/settings.db .dump S Silent (suppress all output)
0 - Auto Dump phone settings.
$ getprop Get properties (e.g. model). Other useful log information:
1 - Internal
$ dumpsys iphonesubinfo Get the IMEI. $ dumpstate Dump current phone state.
2 - External
adb get-serialno Get the serial number. $ dumpsys Dump all system data.
$ dumpsys battery Battery status.
Package info $ pm list users Lists phone users (4.1+). Miscellaneous
$ pm list features List phone features.
$ pm list packages List package names. $ screencap -p <path>.png Screenshot (saved on device).
$ pm list packages -f As above + path to apks. $ screenrecord <path>.mp4 Screen capture (path on device).
Services & activities
$ pm list packages -3 Only third party packages.
$ pm list packages -s Only system packages. $ service list List all services.
ADB daemon
$ pm list packages -u Also uninstalled packages. $ dumpsys activity <package>/<activity>
$ dumpsys package packages List info on all apps. Activity info. adbd runs on TCP/5037.
$ pm dump <name> List info on one package.
Activity Manager usage: adb kill-server Kill the server if it is running.
$ pm path <package> Path to the apk file.
$ am start|startservice|broadcast <INTENT> adb start-server Ensure that there is a server running.
[<COMPONENT>] adb root Restarts the adbd with root permissions.
Permissions where <INTENT> is specified with following options: v 0.2 by @maldr0id
$ pm permission groups Permission groups definitions. -a <ACTION> e.g. android.intent.action.VIEW based on LATEX cheat sheet by Winston Chang
$ pm list permissions -g -f List permissions details. -c <CATEGORY> e.g. android.intent.category.LAUNCHER http://www.stdout.org/winston/latex/

You might also like