Android am PM command

Source: Internet
Author: User
Tags safe mode

The AM PM command in the ADB shell, some of its own insights and most of its website translations.

By the AM command, am full name Activity Manager, you can use AM to simulate the behavior of various systems, such as initiating a activities, forcing the process to stop, sending a broadcast process, modifying device screen properties, and so on. When you execute the AM command under the adb shell command:

Am <command>
You can also perform the AM command in front of the ADB shell:
ADB shell am start-a Android.intent.action.VIEW
Introduction to some of the AM commands:
Start [options] <INTENT>: Starts the activity by specifying the INTENT parameter. The specific intent parameters refer to the official table.

StartService [Options] <INTENT>: Start service with the specified INTENT parameter. The exact intent is the same as the start command parameter.

Force-stop <PACKAGE>: Forces the specified PACKAGE package application to stop.

Kill [Options] <PACKAGE>: Kill the specified PACKAGE package application process, which kills the process in safe mode without affecting the user experience. Parameter options:--user <USER_ID> | All | Current: Specifies that the user process kills if you do not specify default for all users. (Introduction to USER_ID below)

Kill-all: Kill all the background processes.

Broadcast [options] <INTENT>: Send a INTENT. The specific intent parameter refers to the start command argument. Parameter options:--user <USER_ID> | All | Current: Specifies that the user process kills if you do not specify default for all users.

instrument [options] <COMPONENT>: Test command, not much to introduce.

Profile Start <PROCESS> <FILE>: Run profiles in the <PROCESS> process, and the results are written in <FILE>.

Profile Stop <PROCESS>: Stop profile.

Set-debug-app [Options] <PACKAGE>: Set PACKAGE package application as debug mode. Parameter options:-w|--persistent: Wait to enter debug mode, retain the value.

Clear-debug-app: Package package application set before emptying with the Set-debug-app command.

The following command to view the official website:
Monitor [options]
Screen-compat [On|off] <PACKAGE>
Display-size [Reset|<wxh>]
Display-density <dpi>
To-uri <INTENT>
To-intent-uri <INTENT>

Next, PM commands, PM Full name Package Manager, you can use PM command to simulate Android behavior or query device applications, etc., when you execute PM commands under the adb shell command:

PM <command>
You can also perform PM commands in front of the ADB shell:
adb shell pm Uninstall com.example.MyApp
Introduction to some PM commands:
list packages [options] <FILTER>: Print all packages, and select an optional query package. Parameter options:-F: View the associated file, where the APK is applied to the corresponding package name (for example: Package:/system/app/musicplayer.apk=com.sec.android.app.music); d: View disabled PACKAGES;-E: View enable Package;-s: View system package;-3: View Third party package;-i: View package of the corresponding installers (e.g. 1, package:com.tencent.qqmusic Installer=null 2, Package:com.tencent.qqpim installer=com.android.vending);-u: View package that have been uninstalled. (Uninstall and reinstall will still be included);--user<user_id>:the user space to query.

List permission-groups: Print all known permission groups.

List permissions [options] <GROUP>: Selective print permissions. Parameter options:

List features: device characteristics. Performance such as hardware.

List libraries: Libs for current device support.

List users: All users on the system. (The user_id Query method mentioned above, such as: Userinfo{0:primary:3} then user_id to 0)

Path <PACKAGE>: Query the PACKAGE installation location.

Install [options] <PATH>: Installation commands.

uninstall [options] <PACKAGE>: Uninstall command.

Clear <PACKAGE>: Deletes all data for the specified PACKAGE.

Enable <PACKAGE_OR_COMPONENT>: Make PACKAGE or COMPONENT available. (such as: PM Enable "Package/class")

Disable <PACKAGE_OR_COMPONENT>: Make PACKAGE or COMPONENT unavailable. (such as: PM Disable "Package/class")

Disable-user [Options] <PACKAGE_OR_COMPONENT>: Parameter options:--user <user_id>: the user to disable.
Grant <PACKAGE_PERMISSION>: Authorization to application.

Revoke <PACKAGE_PERMISSION>: Revoke permissions.

Set-install-location <LOCATION>: Set the default installation location. 0: Let the system automatically choose the best installation location. 1: Install to the internal device storage space. 2: Install to external device storage space. (This is only for debugging applications, which can cause application exits or other discomfort consequences).

Get-install-location: Returns the current installation location. Returns the result of the above parameter option.

set-permission-enforced <PERMISSION> [True|false]: Make the specified permission effective or invalid.

Create-user <USER_NAME>: Add a new user.

Remove-user <USER_ID>: Deletes a user.

Get-max-users: The maximum number of user supported by this device. (This command is not supported by some devices)

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.