The AM PM command in the ADB shell, some of its own insights and translations for most official websites.
First, the AM command, am full activity Manager, you can use AM to simulate the behavior of various systems, such as to start an activity, force stop process, send broadcast process, modify device screen properties and so on. When you execute the AM command under the adb shell command:
Am <command>
You can also execute the AM command in front of the ADB shell:
ADB shell am start-a Android.intent.action.VIEW
Introduction to some AM commands:
Start [options] <INTENT>: Start activity by specifying the INTENT parameter. Specific intent parameters refer to the official table.
StartService [Options] <INTENT>: Start service by specifying the INTENT parameter. The exact intent is the same as the start command parameter.
Force-stop <PACKAGE>: Forces the specified Package pack app to stop.
Kill [Options] <PACKAGE>: kills the specified package app process, which kills processes in safe mode without impacting the user experience. Parameter options:--user <USER_ID> | All | Current: Specifies that the user process kills if the default is not specified for all users. (about user_id will be introduced below)
Kill-all: kills all background processes.
Broadcast [options] <INTENT>: Send a INTENT. The specific intent parameter refers to the start command parameter. Parameter options:--user <USER_ID> | All | Current: Specifies that the user process kills if the default is not specified for all users.
instrument [options] <COMPONENT>: Test commands, not much for introduction.
Profile Start <PROCESS> <FILE>: Run profiles in the <PROCESS> process and the results are written in <FILE>.
Profile Stop <PROCESS>: Stops profile.
Set-debug-app [Options] <PACKAGE>: Set the package Pack app to debug mode. Parameter options:-w|--persistent: Waits to enter debug mode, leaving the value.
Clear-debug-app: Empty the Package app that was previously set with the Set-debug-app command.
The following command view official website:
Monitor [options]
Screen-compat [On|off] <PACKAGE>
Display-size [Reset|<wxh>]
Display-density <dpi>
To-uri <INTENT>
To-intent-uri <INTENT>
Next, the PM command, PM Full package Manager, you can use the PM command to simulate Android behavior or query device applications, etc., when you execute the PM command under the ADB shell command:
PM <command>
You can also execute 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, select a list of query packages. Parameter options:-F: View the associated file, that is, the location of the app apk and the corresponding package name (for example: Package:/system/app/musicplayer.apk=com.sec.android.app.music);-D: View disabled PACKAGES;-E: View the Enable Package;-s: View system package;-3: View third-party package;-i: View the corresponding installers for the package (e.g.: 1, Package:com.tencent.qqmusic Installer=null 2, Package:com.tencent.qqpim installer=com.android.vending);-U: View the package that has been uninstalled. (Uninstall and reinstall will still be included);--user<user_id>:the user space to query.
List permission-groups: Prints all known permission groups.
List permissions [options] <GROUP>: Selective print permissions. Parameter options:
List features: Device features. Performance such as hardware.
List libraries: Libs supported by the current device.
List users: All users on the system. (The user_id Query method mentioned above, such as: Userinfo{0:primary:3} then user_id is 0)
Path <PACKAGE>: Query the package installation location.
Install [options] <PATH>: Installation command.
uninstall [options] <PACKAGE>: Uninstall command.
Clear <PACKAGE>: Deletes all data for the specified package.
Enable <PACKAGE_OR_COMPONENT>: Make the package or COMPONENT available. (For example: 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>: Licensed to the app.
Revoke <PACKAGE_PERMISSION>: Revoke permissions.
Set-install-location <LOCATION>: Sets the default installation location. 0: Let the system automatically select the best installation location. 1: Install to internal device storage space. 2: Install to external device storage space. (This is used only for debugging applications, which can result in application exits or other uncomfortable consequences.)
Get-install-location: Returns the current installation location. Returns the result as above parameter option.
set-permission-enforced <PERMISSION> [True|false]: Make the specified permission valid or invalid.
Create-user <USER_NAME>: Add a new user.
Remove-user <USER_ID>: Delete a user.
Get-max-users: The maximum number of user supported by this device. (Some devices do not support this command)
am pm command in adb shell