本文共 2161 字,大约阅读时间需要 7 分钟。
1 C:\Users\Administrator>adb shell am 2 usage: am [subcommand] [options] 3 4 start an Activity: am start [-D] [-W]5 -D: enable debugging 6 -W: wait for launch to complete 7 8 start a Service: am startservice 9 10 send a broadcast Intent: am broadcast 11 12 start an Instrumentation: am instrument [flags] 13 -r: print raw results (otherwise decode REPORT_KEY_STREAMRESULT)14 -e : set argument to 15 -p : write profiling data to 16 -w: wait for instrumentation to finish before returning17 18 start profiling: am profile start 19 stop profiling: am profile stop20 21 start monitoring: am monitor [--gdb ]22 --gdb: start gdbserv on the given port at crash/ANR23 24 specifications include these flags:25 [-a ] [-d ] [-t ]26 [-c [-c ] ...]27 [-e|--es ...]28 [--esn ...]29 [--ez ...]30 [-e|--ei ...]31 [-n ] [-f ]32 [--grant-read-uri-permission] [--grant-write-uri-permission]33 [--debug-log-resolution]34 [--activity-brought-to-front] [--activity-clear-top]35 [--activity-clear-when-task-reset] [--activity-exclude-from-recents]36 [--activity-launched-from-history] [--activity-multiple-task]37 [--activity-no-animation] [--activity-no-history]38 [--activity-no-user-action] [--activity-previous-is-top]39 [--activity-reorder-to-front] [--activity-reset-task-if-needed]40 [--activity-single-top]41 [--receiver-registered-only] [--receiver-replace-pending]42 [ ]
格式:adb shell am start -n 包名/包名+类名(-n 类名,-a action,-d date,-m MIME-TYPE,-c category,-e 扩展数据,等)。
实例1:
实例:
adb shell am broadcast -a android.intent.action.BATTERY_CHANGED --ei "level" 3 --ei "scale" 100
转载地址:http://iepuz.baihongyu.com/