adbshellpmlistpackages<FILTER-STR>adbshellpmlistpackages-f<FILTER-STR>#See their associated file.adbshellpmlistpackages-d<FILTER-STR>#Filter to only show disabled packages.adbshellpmlistpackages-e<FILTER-STR>#Filter to only show enabled packages.adbshellpmlistpackages-s<FILTER-STR>#Filter to only show system packages.adbshellpmlistpackages-3<FILTER-STR>#Filter to only show third party packages.adbshellpmlistpackages-i<FILTER-STR>#See the installer for the packages.adbshellpmlistpackages-u<FILTER-STR>#Also include uninstalled packages.adbshellpmlistpackages--user<USER_ID><FILTER-STR>#The user space to query.
adb shell pm path <PACKAGE>
打印给定 APK 的路径。
adbshellpmpathcom.android.phone
adb shell pm clear <PACKAGE>
删除与包相关的所有数据。
adbshellpmclearcom.test.abc
文件管理器
adb pull <remote> [local]
从模拟器/设备下载指定文件到你的计算机。
adbpull/sdcard/demo.mp4./
adb push <local> <remote>
将指定文件从计算机上传到模拟器/设备。
adbpushtest.apk/sdcard
Screencapture/Screenrecord
adb shell screencap <filename>
截取设备显示的屏幕截图。
adbshellscreencap/sdcard/screen.png
adb shell screenrecord [options] <filename>
录制运行 Android 4.4(API 级别 19)及更高版本的设备的显示。
adbshellscreenrecord/sdcard/demo.mp4adbshellscreenrecord--size<WIDTHxHEIGHT>adbshellscreenrecord--bit-rate<RATE>adbshellscreenrecord--time-limit<TIME>#Sets the maximum recording time, in seconds. The default and maximum value is 180 (3 minutes).adbshellscreenrecord--rotate# Rotates 90 degreesadbshellscreenrecord--verbose
(按 Ctrl-C 停止录制)
您可以使用 _adb pull_ 下载文件(图像和视频)**
Shell
adb shell
获取设备内部的 shell
adbshell
adb shell <CMD>
在设备内执行命令
adbshellls
pm
以下命令在 shell 内部执行
pmlistpackages#List installed packagespmpath<packagename>#Get the path to the apk file of tha packageamstart [<options>] #Start an activity. Whiout options you can see the help menuamstartservice [<options>] #Start a service. Whiout options you can see the help menuambroadcast [<options>] #Send a broadcast. Whiout options you can see the help menuinput [text|keyevent]#Send keystrokes to device
adblogcat*:V# lowest priority, filter to only show Verbose leveladblogcat*:D# filter to only show Debug leveladblogcat*:I# filter to only show Info leveladblogcat*:W# filter to only show Warning leveladblogcat*:E# filter to only show Error leveladblogcat*:F# filter to only show Fatal leveladblogcat*:S# Silent, highest priority, on which nothing is ever printed
adb logcat -b <Buffer>
adblogcat-b# radio View the buffer that contains radio/telephony related messages.adblogcat-b# event View the buffer containing events-related messages.adblogcat-b# main defaultadblogcat-c# Clears the entire log and exits.adblogcat-d# Dumps the log to the screen and exits.adblogcat-ftest.logs# Writes log message output to test.logs .adblogcat-g# Prints the size of the specified log buffer and exits.adblogcat-n<count># Sets the maximum number of rotated logs to <count>.
adbbackup [-apk] [-shared] [-system] [-all] -f file.backup# -apk -- Include APK from Third partie's applications# -shared -- Include removable storage# -system -- Include system Applciations# -all -- Include all the applicationsadbshellpmlistpackages-f-3#List packagesadbbackup-fmyapp_backup.ab-apkcom.myapp# backup on one deviceadbrestoremyapp_backup.ab# restore to the same or any other device