Android am/pm help

Source: Internet
Author: User

Am

Usage: am [subcommand] [options]

Usage: am start [-D] [-W] [-P <FILE>] [-- start-profiler <FILE>]
[-- R count] [-S] [-- opengl-trace]
[-- User <USER_ID> | current] <INTENT>
Am startservice [-- user <USER_ID> | current] <INTENT>
Am force-stop [-- user <USER_ID> | all | current] <PACKAGE>
Am kill [-- user <USER_ID> | all | current] <PACKAGE>
Am kill-all
Am broadcast [-- user <USER_ID> | all | current] <INTENT>
Am instrument [-r] [-e <NAME> <VALUE>] [-p <FILE>] [-w]
[-- User <USER_ID> | current]
[-- No-window-animation] <COMPONENT>
Am profile start [-- user <USER_ID> current] <PROCESS> <FILE>
Am profile stop [-- user <USER_ID> current] [<PROCESS>]
Am dumpheap [-- user <USER_ID> current] [-n] <PROCESS> <FILE>
Am set-debug-app [-w] [-- persistent] <PACKAGE>
Am clear-debug-app
Am monitor [-- gdb <port>]
Am screen-compat [on | off] <PACKAGE>
Am display-size [reset | WxH]
Am display-density [reset | DENSITY]
Am to-uri [INTENT]
Am to-intent-uri [INTENT]
Am switch-user <USER_ID>
Am stop-user <USER_ID>


Am start: start an Activity. Options are:
-D: enable debugging
-W: wait for launch to complete
-- Start-profiler <FILE>: start profiler and send results to <FILE>
-P <FILE>: like above, but profiling stops when app goes idle
-R: repeat the activity launch <COUNT> times. Prior to each repeat,
The top activity will be finished.
-S: force stop the target app before starting the activity
-- Opengl-trace: enable tracing of OpenGL functions
-- User <USER_ID> | current: Specify which user to run as; if not
Specified then run as the current user.


Am startservice: start a Service. Options are:
-- User <USER_ID> | current: Specify which user to run as; if not
Specified then run as the current user.


Am force-stop: force stop everything associated with <PACKAGE>.
-- User <USER_ID> | all | current: Specify user to force stop;
All users if not specified.


Am kill: Kill all processes associated with <PACKAGE>. Only kills.
Processes that are safe to kill -- that is, will not impact the user
Experience.
-- User <USER_ID> | all | current: Specify user whose processes to kill;
All users if not specified.


Am kill-all: Kill all background processes.


Am broadcast: send a broadcast Intent. Options are:
-- User <USER_ID> | all | current: Specify which user to send to; if not
Specified then send to all users.


Am instrument: start an Instrumentation. Typically this target <COMPONENT>
Is the form <TEST_PACKAGE>/<RUNNER_CLASS>. Options are:
-R: print raw results (otherwise decode REPORT_KEY_STREAMRESULT). Use
[-E perf true] to generate raw output for performance measurements.
-E <NAME> <VALUE>: set argument <NAME> to <VALUE>. For test runners
Common form is [-e <testrunner_flag> <value> [, <value>...].
-P <FILE>: write profiling data to <FILE>
-W: wait for instrumentation to finish before returning. Required
Test runners.
-- User <USER_ID> | current: Specify user instrumentation runs in;
Current user if not specified.
-- No-window-animation: turn off window animations will running.


Am profile: start and stop profiler on a process. The given <PROCESS> argument
May be either a process name or pid. Options are:
-- User <USER_ID> | current: When supplying a process name,
Specify user of process to profile; uses current user if not specified.


Am dumpheap: dump the heap of a process. The given <PROCESS> argument may
Be either a process name or pid. Options are:
-N: dump native heap instead of managed heap
-- User <USER_ID> | current: When supplying a process name,
Specify user of process to dump; uses current user if not specified.


Am set-debug-app: set application <PACKAGE> to debug. Options are:
-W: wait for debugger when application starts
-- Persistent: retain this value


Am clear-debug-app: clear the previusly set-debug-app.


Am bug-report: request bug report generation; will launch UI
When done to select where it shoshould be delivered.
Am monitor: start monitoring for crashes or ANRs.
-- Gdb: start gdbserv on the given port at crash/ANR


Am screen-compat: control screen compatibility mode of <PACKAGE>.


Am display-size: override display size.


Am display-density: override display density.


Am to-uri: print the given Intent specification as a URI.


Am to-intent-uri: print the given Intent specification as an intent: URI.


Am switch-user: switch to put USER_ID in the foreground, starting
Execution of that user if it is currently stopped.


Am stop-user: stop execution of USER_ID, not allowing it to run any
Code until a later explicit switch to it.


<INTENT> specifications include these flags and arguments:
[-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>...]
[-- Ei <EXTRA_KEY> <EXTRA_INT_VALUE>...]
[-- El <EXTRA_KEY> <EXTRA_LONG_VALUE>...]
[-- Ef <EXTRA_KEY> <EXTRA_FLOAT_VALUE>...]
[-- Eu <EXTRA_KEY> <EXTRA_URI_VALUE>...]
[-- Ecn <EXTRA_KEY> <EXTRA_COMPONENT_NAME_VALUE>]
[-- Eia <EXTRA_KEY> <EXTRA_INT_VALUE> [, <EXTRA_INT_VALUE...]
[-- Ela <EXTRA_KEY> <EXTRA_LONG_VALUE> [, <EXTRA_LONG_VALUE...]
[-- Efa <EXTRA_KEY> <EXTRA_FLOAT_VALUE> [, <EXTRA_FLOAT_VALUE...]
[-N <COMPONENT>] [-f <FLAGS>]
[-- Grant-read-uri-permission] [-- grant-write-uri-permission]
[-- Debug-log-resolution] [-- exclude-stopped-packages]
[-- Include-stopped-packages]
[-- 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] [-- activity-clear-task]
[-- Activity-task-on-home]
[-- Cycler-registered-only] [-- Cycler-replace-pending]
[-- Selector]

[<URI >|< PACKAGE >|< COMPONENT>]


Sample:

Am start-n com. android. music/com. android. music. MediaPlaybackActivity-d/system/media/audio/bootaudioaudio-S-W





========================================================== ========================================================== ======================================





Pm

Usage: pm list packages [-f] [-d] [-e] [-s] [-3] [-I] [-u] [-- user USER_ID] [FILTER]
Pm list permission-groups
Pm list permissions [-g] [-f] [-d] [-u] [GROUP]
Pm list instrumentation [-f] [TARGET-PACKAGE]
Pm list features
Pm list libraries
Pm list users
Pm path PACKAGE
Pm install [-l] [-r] [-t] [-I INSTALLER_PACKAGE_NAME] [-s] [-f]
[-- Algo <algorithm name> -- key <key-in-hex> -- iv <IV-in-hex>]
[-- Originating-uri <URI>] [-- referrer <URI>] PATH
Pm uninstall [-k] PACKAGE
Pm clear [-- user USER_ID] PACKAGE
Pm enable [-- user USER_ID] PACKAGE_OR_COMPONENT
Pm disable [-- user USER_ID] PACKAGE_OR_COMPONENT
Pm disable-user [-- user USER_ID] PACKAGE_OR_COMPONENT
Pm grant PACKAGE PERMISSION
Pm revoke PACKAGE PERMISSION
Pm set-install-location [0/auto] [1/internal] [2/external]
Pm get-install-location
Pm set-permission-enforced PERMISSION [true | false]
Pm trim-caches DESIRED_FREE_SPACE
Pm create-user USER_NAME
Pm remove-user USER_ID
Pm get-max-users


Pm list packages: prints all packages, optionally only
Those whose package name contains the text in FILTER. Options:
-F: see their associated file.
-D: filter to only show disbled packages.
-E: filter to only show enabled packages.
-S: filter to only show system packages.
-3: filter to only show third party packages.
-I: see the installer for the packages.
-U: also include uninstalled packages.


Pm list permission-groups: prints all known permission groups.


Pm list permissions: prints all known permissions, optionally only
Those in GROUP. Options:
-G: organize by group.
-F: print all information.
-S: short summary.
-D: only list dangerous permissions.
-U: list only the permissions users will see.


Pm list instrumentation: use to list all test packages; optionally
Supply <TARGET-PACKAGE> to list the test packages for a participant
Application. Options:
-F: list the. apk file for the test package.


Pm list features: prints all features of the system.


Pm list users: prints all users on the system.


Pm path: print the path to the. apk of the given PACKAGE.


Pm install: installa package to the system. Options:
-L: install the package with FORWARD_LOCK.
-R: reinstall an exisiting app, keeping its data.
-T: allow test. apks to be installed.
-I: specify the installer package name.
-S: install package on sdcard.
-F: install package on internal flash.
-D: allow version code downgrade.


Pm uninstall: removes a package from the system. Options:
-K: keep the data and cache directories around und after package removal.


Pm clear: deletes all data associated with a package.


Pm enable, disable, disable-user: these commands change the enabled state
Of a given package or component (written as "package/class ").


Pm grant, revoke: these commands either grant or revoke permissions
To applications. Only optional permissions the application has
Declared can be granted or revoked.


Pm get-install-location: returns the current install location.
0 [auto]: Let system decide the best location
1 [internal]: Install on internal device storage
2 [external]: Install on external media


Pm set-install-location: changes the default install location.
NOTE: this is only intended for debugging; using this can cause
Applications to break and other undersireable behavior.
0 [auto]: Let system decide the best location
1 [internal]: Install on internal device storage
2 [external]: Install on external media


Pm trim-caches: trim cache files to reach the given free space.


Pm create-user: create a new user with the given USER_NAME,
Printing the new user identifier of the user.


Pm remove-user: remove the user with the given USER_IDENTIFIER,
Deleting all data associated with that user


Sample:

Pm list packages com. marvell.


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.