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
屏幕截图/录屏
adb shell screencap <文件名>
对设备显示屏进行截图。
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
(press Ctrl-C to stop recording)
您可以使用 _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 <缓冲区>
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