Saturday, March 4, 2017

Package Manager Commands in android



                                 please like & Subscribe our youtube channel

         https://www.youtube.com/playlist?list=PLQzJncZC8PUwCTcniu_akzp0N0oDx7l1n



What is Package Manager Commands




Package manager (pm) command apply to all android package it may be system application or third-party application packages. We can perform actions and queries on application packages installed on the device.

1) List package

This command use to view all android application packages on your device.


                                 Ex: pm list package






We can also filter the list of packages.

Ex: as list packages [options] <FILTER>
And types of filter
-f: view associated file.
-d: view disabled packages.
-e: view enabled packages.
-s: contain system packages.
-3: view third party packages.
-i: contain installer for the packages.


-u: include uninstalled packages.

2) List group permission

List permission group command use to show all group Permission which used for android application package in the device just like the camera, battery, network etc.


Ex: pm list permission-groups



We can filter groups.
-g: Organize by the group.
-f: Print all information.
-s: Short summary.
-d: Only list dangerous permissions.
-u: List only the permissions users will see.


Ex: pm list permissions [options] <GROUP>




3) list instrumentation

This command shows the list of all test packages.
Ex: pm list instrumentation –f

-f : Use for the list of apk files.



4) System features

It shows all features of the device just like the camera, Bluetooth, network, and map etc.


Ex: pm list features


5) list of libraries

This command use to show all android libraries in which are use in device currently.


Ex: pm list libraries 


6) List users

This command show list of all users currently uses in the device.


Ex: pm list users


7) apk Path

Through this command, we can find apk full path in the device.


Ex: pm path <package name>




8) Install application


From this command, we can install any apk in any specific location in our device.

Ex: pm install [option] <path>

There are many types of option for installation.

-r: Reinstall an existing app, keeping its data.
-t: Allow test APKs to be installed.
-i: Specify the installer package name.
-s: Install the package on the shared mass storage (sd card).
-f: Install the package on the internal system memory.


-d: Allow version code downgrade.




9) Uninstall Application

This command use to uninstall any application from the device.



Ex: pm uninstall <package>



We can keep the data and cache directories using option


Ex: pm uninstall [option] <package>


10) Clear package


This pm command uses to clear all data associated with the package.



Ex: pm clear <package name>





11) Enable package  component

This pm command uses to enable any package or component like the class in your device.


Ex: pm enable <package or class name>


13) Disable package or component

This pm command uses to disable any package or component like the class in your device.

Ex: pm disable <package or class name>

14) Granted permission

This command use to provide user permission to package.


Ex: pm grant <package permission>


15) Set install location

This command use to install any application on particular location
Ex:  pm set-install-location <LOCATION>
We can install in three locations
0 [auto]-represented to system location
1[internal]- represented to internal  location


2[external]- represented to system location




No comments:

Post a Comment