Created
July 30, 2020 08:11
-
-
Save hhhaiai/33b1e857dbf547ff025db71cd534f50a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # android am 命令 | |
| ## am 指令 | |
| ``` shell | |
| start an Activity: am start [-D] [-W] <INTENT> | |
| -D: enable debugging | |
| -W: wait for launch to complete | |
| start a Service: am startservice <INTENT>** | |
| send a broadcast Intent: am broadcast <INTENT> | |
| start an Instrumentation: am instrument [flags] <COMPONENT> | |
| -r: print raw results (otherwise decode REPORT_KEY_STREAMRESULT) | |
| -e <NAME> <VALUE>: set argument <NAME> to <VALUE> | |
| -p <FILE>: write profiling data to <FILE> | |
| -w: wait for instrumentation to finish before returning | |
| start profiling: am profile <PROCESS> start <FILE> | |
| stop profiling: am profile <PROCESS> stop | |
| start monitoring: am monitor [--gdb <port>] | |
| --gdb: start gdbserv on the given port at crash/ANR | |
| ``` | |
| ## Intent | |
| ``` shell | |
| <INTENT> specifications include these flags: | |
| [-a <ACTION>] [-d <DATA_URI>] [-t <MIME_TYPE>] | |
| [-c <CATEGORY> [-c <CATEGORY>] ...] | |
| [-e|--es <EXTRA_KEY> <EXTRA_STRING_VALUE> ...] | |
| [--esn <EXTRA_KEY> ...] | |
| [--ez <EXTRA_KEY> <EXTRA_BOOLEAN_VALUE> ...] | |
| [-e|--ei <EXTRA_KEY> <EXTRA_INT_VALUE> ...] | |
| [-n <COMPONENT>] [-f <FLAGS>] | |
| [--grant-read-uri-permission] [--grant-write-uri-permission] | |
| [--debug-log-resolution] | |
| [--activity-brought-to-front] [--activity-clear-top] | |
| [--activity-clear-when-task-reset] [--activity-exclude-from-recents] | |
| [--activity-launched-from-history] [--activity-multiple-task] | |
| [--activity-no-animation] [--activity-no-history] | |
| [--activity-no-user-action] [--activity-previous-is-top] | |
| [--activity-reorder-to-front] [--activity-reset-task-if-needed] | |
| [--activity-single-top] | |
| [--receiver-registered-only] [--receiver-replace-pending] | |
| [<URI>] | |
| ``` | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment