Show Menu

Android Package Manager (pm) Cheat Sheet by

How to use the Android Package Manager (pm)
commands     manager     android     package     pm     cli

pm commands

list permis­sio­n-g­roups
Prints all known permission groups
list features
Prints all features of the system
list librar­ies
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 | COMPON­ENT
Enable given package or component (written as "­pac­kag­e/c­las­s")
disable PKG | COMPON­ENT
Disable given package or component (written as "­pac­kag­e/c­las­s")
grant PERMIS­SION
Grant permis­sions to applic­ations. Only optional permis­sions the applic­ation has declared can be granted.
revoke PERMIS­SION
Revoke permis­sions to applic­ations. Only optional permis­sions the applic­ation has declared can be revoked.
set-­per­mis­sio­n-e­nforced PERMISSION [true|­fal­se]
Specifies whether the given permission should be enforced.
trim­-caches DESIRE­D_F­REE­_SP­ACE
Trim cache files to reach given free space
crea­te-user USERNAME
Create new user with given USERNAME, printing the new user identifier of the user
remo­ve-user USER_ID
Remove the user with given USER_ID, deleting all data associated with that user
get-­max­-us­ers
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
unin­stall [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-­ins­tal­l-l­ocation 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-­ins­tal­l-l­oca­tion
 

pm commands : disabl­e-user

--user USER_ID
User to disable
disa­ble­-user [options] (PKG | COMPON­ENT)

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 [optio­ns]

Download the Android Package Manager (pm) Cheat Sheet

2 Pages
//media.cheatography.com/storage/thumb/citguy_android-package-manager-pm.750.jpg

PDF (recommended)

Alternative Downloads

Share This Cheat Sheet!

Like this cheat sheet? Check out our sponsors!

Readable.io is a collection of tools to make your writing better. More readable content means higher conversion rates and better reader engagement. Measure website and document readability, measure keyword density and more!

Click Here To Get Started!

 

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

          More Cheat Sheets by CITguy

          jasmine JS testing Cheat Sheet
          Extending Ruby with C - Part 1 Cheat Sheet
          *nix users and groups Cheat Sheet