ADB shell am Use this command to start activity, services, send broadcast, etc. from the cmd console:
1C:\users\administrator>adb shell am2 usage:am [subcommand] [options]3 4Start an activity:am start [-d] [-W] <INTENT>5-d:enable Debugging6-W:wait forlaunch to complete7 8Start a service:am startservice <INTENT>9 TenSend a broadcast intent:am broadcast <INTENT> One AStart an INSTRUMENTATION:AM instrument [flags] <COMPONENT> --R:print Raw Results (otherwise decode Report_key_streamresult) --e <NAME> <value>: set argument <NAME> to <VALUE> the-P <file>:WriteProfiling data to <FILE> --W:wait forinstrumentation to finish before returning - -Start Profiling:am profile <PROCESS> start <FILE> +Stop Profiling:am Profile <PROCESS>Stop - +Start Monitoring:am Monitor [--gdb <port>] A--gdb:start Gdbserv on the given port at crash/ANR at -<INTENT>specifications include these flags: -[-a <action>] [-D ] [-T <MIME_TYPE>] -[-C <CATEGORY> [-C <CATEGORY>] ...] -[-e|--es <EXTRA_KEY> <EXTRA_STRING_VALUE> ...] -[--esn <EXTRA_KEY> ...] in[--ez <EXTRA_KEY> <EXTRA_BOOLEAN_VALUE> ...] -[-e|--ei <EXTRA_KEY> <EXTRA_INT_VALUE> ...] to[-n <component>] [-F <FLAGS>] +[--grant-read-uri-permission] [--grant-Write-uri-permission] -[--debug-log-resolution] the[--activity-brought-to-front] [--activity-Clear-Top] *[--activity-Clear-when-task-reset] [--activity-exclude-from-Recents] $[--activity-launched-from-history] [--activity-multiple-Task]Panax Notoginseng[--activity-no-animation] [--activity-no-History ] -[--activity-no-user-action] [--activity-previous-is-Top] the[--activity-reorder-to-front] [--activity-reset-task-if-needed] +[--activity-single-Top] A[--receiver-registered-only] [--receiver-replace-Pending] the[<uri>]
Use instances: such as starting an Activity:
-N Package Name/package name + class name (-N class name,-a action,-d date,-m mime-type,-c category,-e Extended data, etc.).
Example 1:
C:\USERS\ADMINISTRATOR>ADB Shell am start-n com.android.camera/. Camera
starting:intent {cmp=com.android.camera/. Camera}
Example 2: (Intent with extra) c:\users\administrator>adb shell am start-n com.android.camera/. CAMERA-E ABC Hello
starting:intent {cmp=com.android.camera/. Camera (has extras)} where extra's key is ABC, value is the string "Hello" and can also send commands to simulate the mobile low-power environment:
Instance:
ADB shell am broadcast-a android.intent.action.BATTERY_CHANGED--ei "level" 3--ei "scale" 100