Show Menu
Cheatography

Android Package Manager (pm) Cheat Sheet by

How to use the Android Package Manager (pm)

pm commands

list permis­sio­n-g­roups
Prints all known permission groups
list features
Prints all features of the system
list libraries
Prints all the libraries supported by current device
list users
Prints all users on system
path PACKAGE
Print the path to the APK of given PACKAGE
clear PACKAGE
Deletes all data associated with a package
enable PKG | COMPONENT
Enable given package or component (written as "­pac­kag­e/c­las­s")
disable PKG | COMPONENT
Disable given package or component (written as "­pac­kag­e/c­las­s")
grant PERMISSION
Grant permis­sions to applic­ations. Only optional permis­sions the applic­ation has declared can be granted.
revoke PERMISSION
Revoke permis­sions to applic­ations. Only optional permis­sions the applic­ation has declared can be revoked.
set-pe­rmi­ssi­on-­enf­orced PERMISSION [true|­false]
Specifies whether the given permission should be enforced.
trim-c­aches DESIRE­D_F­REE­_SPACE
Trim cache files to reach given free space
create­-user USERNAME
Create new user with given USERNAME, printing the new user identifier of the user
remove­-user USER_ID
Remove the user with given USER_ID, deleting all data associated with that user
get-ma­x-users
Prints the maximum number of users supported by the device
 

pm command : install

-l
Install package with forward lock
-r
Reinstall an existing app, keeping its data
-t
Allow test APKs to be installed
-i NAME
Specify the installer package name
-s
Install package on the shared mass storage (such as sdcard)
-f
Install package on internal system memory
-d
Allow version code downgrade
install [options] <PA­TH>

pm command : uninstall

-k
Keep the data and cache direct­ories around after removal
uninstall [options] <PA­CKA­GE>

pm command : set-in­sta­ll-­loc­ation

Location Values
0
Auto - let system decide best location
1
Internal - internal device storage
2
External - install on external media
set-in­sta­ll-­loc­ation LOCATION

pm command : get-in­sta­ll-­loc­ation

Return Values
0
Auto - system decides best location
1
Internal - internal device storage
2
External - install on external media
get-in­sta­ll-­loc­ation
 

pm commands : disabl­e-user

--user USER_ID
User to disable
disabl­e-user [options] (PKG | COMPONENT)

pm command : list packages

-f
See their associated file
-d
Only show disabled packages
-e
Only show enabled packages
-s
Only show system packages
-3
Only show third party packages
-i
See the installer for the packages
-u
Include uninst­alled packages
--user <US­ER_­ID>
User space to query
list packages [options] <FI­LTE­R>

pm command : list permis­sions

-g
Organize by group
-f
Print all inform­ation
-s
Short summary
-d
Only list dangerous permis­sions
-u
Only list permis­sions users will see
list permis­sions [options] <GR­OUP>

pm command : list instru­men­tation

-f
List the APK file for the test package
list instru­men­tation [options]
                   
 

Comments

No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          Android Activity Manager (am) Cheat Sheet
          Basic Cisco IOS Commands Cheat Sheet
          Windows OS Basic CLI 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