adb shell
: To use these commands from your computerβs terminal/command prompt, prefix with adb shell
.adb shell pm list packages
adb root
on emulators or permissive builds.--help
or -h
for many commands. Example: adb shell pm --help
pm
)pm list packages
β List all installed packagespm list packages -f
β List packages with their APK pathspm list packages -d
β List disabled packagespm list packages -e
β List enabled packagespm list packages -s
β List system packagespm list packages -3
β List user-installed (third-party) packagespm list packages <FILTER_STRING>
β Filter packages by namepm path <PACKAGE_NAME>
β Show APK path of a packagepm install <PATH_TO_APK>
β Install an APKpm install -r <PATH_TO_APK>
β Reinstall app (keep data)pm install -g <PATH_TO_APK>
β Install & grant all runtime permissionspm uninstall <PACKAGE_NAME>
β Uninstall a packagepm uninstall -k <PACKAGE_NAME>
β Uninstall but keep data/cachepm clear <PACKAGE_NAME>
β Clear all app datapm enable <PACKAGE_NAME>
β Enable a packagepm disable <PACKAGE_NAME>
or pm disable-user --user 0 <PACKAGE_NAME>
β Disable a packagepm grant <PACKAGE_NAME> <PERMISSION>
β Grant a runtime permissionpm revoke <PACKAGE_NAME> <PERMISSION>
β Revoke a permissionpm get-install-location
β Get default install locationpm set-install-location <0|1|2>
β Set default install location (0:auto,1:internal,2:external)am
)am start -n <PACKAGE>/<ACTIVITY>
β Start an activityam start -n com.android.settings/.Settings
am start -a <ACTION> -d <DATA_URI> -t <MIME>
β Start with intentam start -a android.intent.action.VIEW -d http://www.google.com
am startservice <PACKAGE>/<SERVICE>
β Start a serviceam stopservice <PACKAGE>/<SERVICE>
β Stop a serviceam broadcast -a <ACTION>
β Send a broadcast intentam force-stop <PACKAGE>
β Force stop appam kill <PACKAGE>
β Kill all processes for a packageam kill-all
β Kill all background processesam display-density <DENSITY>
β Change display densityam display-size <WIDTHxHEIGHT>
β Change display sizeam screen-compat [on|off] <PACKAGE>
β Control screen compatibilityam stack list
β List activity stacks/tasks (newer Android)am task <TASK_ID>
β Show task infols
, ls -a
, ls -l
β List filescd <DIR>
β Change directorypwd
β Print working directorymkdir <DIR>
β Create directoryrm <FILE>
β Delete filerm -r <DIR>
β Delete directory recursivelyrm -f <FILE>
β Force deletecp <SRC> <DEST>
β Copy filescp -r <SRC> <DEST>
β Copy directoriesmv <SRC> <DEST>
β Move/rename filescat <FILE>
β View file contentshead <FILE>
β View first linestail <FILE>
β View last linestail -f <FILE>
β Live follow file (logs)touch <FILE>
β Create empty file or update timestampchmod <PERMISSIONS> <FILE>
β Change permissionschown <OWNER>:<GROUP> <FILE>
β Change owner/groupdf
β Show free spacedu
, du -h <DIR>
β Show disk usagefind <PATH> -name "<PATTERN>"
β Search filesgrep "<PATTERN>" <FILE>
β Search inside filesgetprop
β Show all system propertiesgetprop <PROPERTY>
β Show a specific propertysetprop <PROPERTY> <VALUE>
β Set property (root required)settings list system|global|secure
β List settingssettings get <NAMESPACE> <SETTING>
β Get settingsettings put <NAMESPACE> <SETTING> <VALUE>
β Set settingdumpsys <SERVICE>
β Dump system info for a serviceservice list
β List running servicesip addr
or ifconfig
β Show network interfacesip route
or route -n
β Show routing tableping <HOST>
β Ping a hostnetstat
, netstat -tulnp
β Network connections/portsiptables -L
β List firewall rules (root)svc wifi [enable|disable]
β Toggle Wi-Fisvc data [enable|disable]
β Toggle mobile dataps
, ps -A
, ps -ef
β List processesps -T
β Show threadstop
β Live CPU/memory usagekill <PID>
β Kill processkill -9 <PID>
β Force killrenice <PRIORITY> <PID>
β Change prioritylogcat
)logcat
β View logslogcat -c
β Clear logslogcat -d
β Dump and exitlogcat -v <FORMAT>
β Choose formatlogcat <TAG>:<PRIORITY> *:S
β Filter logs (Priorities: V, D, I, W, E, F, S)input text "<TEXT>"
β Simulate typinginput keyevent <KEYCODE>
β Simulate key pressinput tap <X> <Y>
β Simulate tapinput swipe <X1> <Y1> <X2> <Y2> [DUR]
β Simulate swipegetevent
β Monitor input eventssendevent
β Send low-level input eventsscreencap /sdcard/screenshot.png
β Take screenshotscreenrecord /sdcard/video.mp4
β Record screenscreenrecord --time-limit 10 <FILE>
β Limit durationscreenrecord --size <WxH>
β Set video sizescreenrecord --bit-rate <BPS>
β Set bitratereboot
, reboot bootloader
, reboot recovery
β Reboot devicesetenforce [0|1]
β Toggle SELinux mode (root)getenforce
β Show SELinux modedate
β Show/set date/timeid
, whoami
β Show user infovmstat
β Virtual memory statswhich <COMMAND>
β Find command pathmonkey -p <PACKAGE> -v <EVENT_COUNT>
β UI stress testcmd <SERVICE> ...
β Interact with system services