Show Menu

Android Activity Manager (am) Cheat Sheet by

Shortcuts for Android Activity Manager (am)

am commands

force-stop <PA­CKA­GE>
Force stop everything associated with <PA­CKA­GE> (the app's package name)
Kill all background processes
profile start <PR­OCE­SS> <FI­LE>
Start profiler on <PR­OCE­SS>, write results to <FI­LE>
profile stop <PR­OCE­SS>
Stop profiler on <PR­OCE­SS>
screen­-compat [on|off] <PA­CKA­GE>
Control screen compat­ibility mode of <PA­CKA­GE>
displa­y-size [reset­|<W­xH>]
Override emulat­or/­device display size
displa­y-d­ensity <dp­i>
Override emulat­or/­device display density
to-uri <IN­TEN­T>
Print the given intent specif­ication as a URI
to-int­ent-uri <IN­TEN­T>
Print the given intent specif­ication as an intent: URI.
Clear the package previous set for debugging with set-de­bug-app

am command : set-de­bug-app

set-de­bug-app [options] <PA­CKA­GE>
Set applic­ation <PA­CKA­GE> to debug.
Wait for debugger when applic­ation starts
Retain this value

am command : broadcast

broadcast [options] <IN­TEN­T>
Issue a broadcast intent.
--user [<U­SER­_ID> | all | current]
Specify which user to send to; if not specified then send to all users.

am command : instrument

instrument [options] <CO­MPO­NEN­T>
Start monitoring with an Instru­men­tation instance. Typically the target <CO­MPO­NEN­T> is the form <TE­ST_­PAC­KAG­E> / <RU­NNE­R_C­LAS­S>.
Print raw results (otherwise decode <RE­POR­T_K­EY_­STR­EAM­RES­ULT­>). Use with [-e perf true] to generate raw output for perfor­mance measur­ements.
-e <NA­ME> <VA­LUE>
Set argument <NA­ME> to <VA­LUE­>. For test runners a common form is -e <te­str­unn­er_­fla­g> <va­lue­>[,­<va­lue> ...]
-p <FI­LE>
Write profiling data to <FI­LE>
Wait for instru­men­tation to finish before returning. Required for test runners.
Turn off window animations while running
--user [<U­SER­_ID­>]
Specify which user instru­men­tation runs in; current user if not specified

am command : monitor

monitor [options]
Start monitoring for crashes or ANRs
Start gdbserv on the given port at crash/ANR

am command : dumpheap

dumpheap [options] <PR­OCE­SS> <FI­LE>
Dump the heap of <PR­OCE­SS>, write to <FI­LE>
--user [<U­SER­_ID­>]
When supplying a process name, specify user of process to dump; uses current user if not specified.
Dump native heap instead of managed heap

am command : start

start [options] <IN­TEN­T>
Start an Activity specified by <IN­TEN­T>
Enable Debugging
Wait for launch to complete
--star­t-p­rofiler <FI­LE>
Start profiler and send results to <FI­LE>
-P <FI­LE>
Like --star­t-p­rofiler, but profiling stops when the app goes idle.
Repeat the activity launch <CO­UNT> times. Prior to each repeat, the top activity will be finished.
Force stop the target app before starting the activity.
Enable tracing of OpenGL functions
--user [<U­SER­_ID­>]
Specify which user to run as; if not specified, then run as the current user.

am command : starts­ervice

starts­ervice [options] <IN­TEN­T>
Start the Service specified by <IN­TEN­T>
--user [<U­SER_ID]
Specify which user to run as; if not specified, then run as the current user.

am command : kill

kill [options] <PA­CKA­GE>
Kill all processes associated with <PA­CKA­GE> (the app's package name). This command kills only processes that are safe to kill and that will not impact the user experi­ence.
--user [<U­SER­_ID> | all | current]
Specify user whose processes to kill; all users if not specified.


How to get the permissions list the application have for a secondary user?

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          Android Package Manager (pm) Cheat Sheet
          Basic Cisco IOS Commands Cheat Sheet

          More Cheat Sheets by CITguy

          jasmine JS testing Cheat Sheet
          Extending Ruby with C - Part 1 Cheat Sheet
          *nix users and groups Cheat Sheet