For details about the PM command, see PM help. Today, I only want to talk about the PM enable, disable, and disable-user package_or_component commands!
The mobile phone must have the root permission to prohibit the Application Command PM disable package_or_component you specified. But how to restore it?
PM enable package_or_component is inevitable, but unfortunately, package package_or_component new State: disabled is returned. The State is still disable.
In fact, you only need to execute the command PM disable-user package_or_component, and then execute PM enable package_or_component. The returned value is package package_or_component new State: enabled. You can re-install this program on your mobile phone, or you can resume to start it!
PM disable-user package_or_component can be considered as a user-type disable. That's what I understand! Record! Hope to be useful to everyone!
Attached PM command usage:
Usage: PM list packages [-F] [-D] [-E] [-S] [-E] [-u] [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 path package
PM install [-L] [-R] [-T] [-I installer_package_name] [-S] [-F] path
PM uninstall [-K] package
PM clear package
PM enable package_or_component
PM disable package_or_component
PM disable-user package_or_component
PM set-install-location [0/auto] [1/internal] [2/external]
PM get-install-location
PM createuser user_name
PM removeuser user_id
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.
-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 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.
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 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
Root @ Android:/# PM uninstall-K com. softel. safebox
PM uninstall-K com. softel. safebox
Success
Root @ Android:/# PM enable com. softel. safebox
PM enable com. softel. safebox
Package com. softel. safebox new State: Disabled
Root @ Android:/# PM enable com. softel. safebox
PM enable com. softel. safebox
Package com. softel. safebox new State: Disabled
Root @ Android:/# PM disable-user com. softel. safebox
PM disable-user com. softel. safebox
Package com. softel. safebox new State: Disabled-user
Root @ Android:/# PM enable com. softel. safebox
PM enable com. softel. safebox
Package com. softel. safebox new State: Enabled
Root @ Android:/# PM disable-user com. qihoo360.mobilesafe
PM disable-user com. qihoo360.mobilesafe
Package com. qihoo360.mobilesafe new State: Disabled-user
Root @ Android:/# PM enable com. qihoo360.mobilesafe
PM enable com. qihoo360.mobilesafe
Package com. qihoo360.mobilesafe new State: Enabled
Root @ Android :/#
C: \ Users \ Jude> ADB Shell
Shell @ Android:/$ PM help
PM help
Error: Unknown command 'help'
Usage: PM list packages [-F] [-D] [-E] [-S] [-E] [-u] [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 path package
PM install [-L] [-R] [-T] [-I installer_package_name] [-S] [-F] path
PM uninstall [-K] package
PM clear package
PM enable package_or_component
PM disable package_or_component
PM disable-user package_or_component
PM set-install-location [0/auto] [1/internal] [2/external]
PM get-install-location
PM createuser user_name
PM removeuser user_id
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.
-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 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.
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 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