Call activity manager (am)

Within an adb shell, you can issue commands with the activity manager (am) tool to perform various system actions, such as start an activity, force-stop a process, broadcast an intent, modify the device screen properties, and more. You can issue an activity manager command directly from adb without entering a remote shell. For example:

adb shell am start -a android.intent.action.VIEW

Command

Start an Activity specified by intent. Options are:

adb shell am start [options] intent

Start the Service specified by intent. Options are:

adb shell am startservice [options] intent

Force stop everything associated with package (the app's package name).

adb shell am force-stop package

Kill all processes associated with package (the app's package name). This command kills only processes that are safe to kill and that will not impact the user experience. Options are:

adb shell am kill [options] package

Kill all background processes.

adb shell am kill-all

Issue a broadcast intent. Options are:

adb shell am broadcast [options] intent

Start monitoring with an Instrumentation instance. Typically the target component is the form test_package/runner_class. Options are:

adb shell am instrument [options] component

Start profiler on process, write results to file.

adb shell am profile start process  file

Stop profiler on process.

adb shell am profile stop process

Dump the heap of process, write to file. Options are:

adb shell am dumpheap [options] process  file

Set app package to debug. Options are:

adb shell am set-debug-app [options] package

Clear the package previous set for debugging with set-debug-app.

adb shell am clear-debug-app

Start monitoring for crashes or ANRs. Options are:

adb shell am monitor [options]

Control screen compatibility mode of package.

adb shell am screen-compat {on | off} package

Override device display size. This command is helpful for testing your app across different screen sizes by mimicking a small screen resolution using a device with a large screen, and vice versa. Example:

adb shell am display-size [reset | widthxheight]

Override device display density. This command is helpful for testing your app across different screen densities on high-density screen environment using a low density screen, and vice versa. Example:

adb shell am display-density dpi

Print the given intent specification as a URI.

adb shell am to-uri intent

Print the given intent specification as an intent: URI.

adb shell am to-intent-uri intent