Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
list all installed packages in android adb shell
pm list packages -f
Copy link

hammerhai commented Jan 14, 2019

help needed here !
command for installing a package of github into android system via shell.
After trying the command **pm install **
i get the error..
127|shell@tegranote:/system/bin $ pm install> pkg: Failure [INSTALL_FAILED_I

If you're trying to install an app via ADB, do adb install in the same folder as your current CMD is pointing into, or ADB folder.

Copy link

afilp commented Feb 9, 2019

Any idea how to do the same in Windows 10? (not in bash)

Copy link

OldStarchy commented Apr 4, 2019

@afilp the command Anuboiz posted earlier works fine in windows 10, if you're talking about installing packages, the comment above yours should work fine too.

Copy link

ghost commented Sep 7, 2019

How about to list all the packages for a specific --user ?

Copy link

Flakie99 commented Feb 20, 2020

This gives a list of just 3rd party apps (or it does on my firestick 4k) if it helps:
shell sh -c 'cmd package list packages -f -3' | sed -e 's/.*=//' | sort

Copy link

Flakie99 commented Feb 21, 2020

adb shell cmd package list packages

list packages [-f] [-d] [-e] [-s] [-3] [-i] [-l] [-u] [-U] [--uid UID] [--user USER_ID] [FILTER]

Prints all packages; optionally only those whose name contains
the text in FILTER.
-f: see their associated file
-d: filter to only show disabled packages
-e: filter to only show enabled packages
-s: filter to only show system packages
-3: filter to only show third party packages
-i: see the installer for the packages
-l: ignored (used for compatibility with older releases)
-U: also show the package UID
-u: also include uninstalled packages
--uid UID: filter to only show packages with the given UID
--user USER_ID: only list packages belonging to the given user

Copy link

soufian2017 commented May 1, 2020

adb shell 'pm list packages' | sed 's/.*://g'

Copy link

AlexzPurewoko commented Mar 29, 2021

Uninstall all installed apks.
adb shell 'pm list packages -f' | grep '/data/app/' | sed -e 's/.*=//' | while read comm; do echo "uninstall $comm"; adb uninstall $comm; done;

Copy link

hiteshsahu commented May 13, 2021

Nice one liner: " adb shell 'pm list packages -f' "

List all a package works even without quotes:

adb shell pm list packages -f

Other Commands
  • adb shell list packages (list package names)
  • adb shell list packages -r (list package name + path to apks)
  • adb shell list packages -3 (list third party package names)
  • adb shell list packages -s (list only system packages)
  • adb shell list packages -u (list package names + uninstalled)
  • adb shell dumpsys package packages (list info on all apps)
  • adb shell dump (list info on one package)
  • adb shell path (path to the apk file)

Copy link

AndroidDeveloperLB commented Jul 8, 2021

Hi all.
I'm trying to get list of installed apps, together with as many of the next files as possible :

  1. installed time
  2. Updated time
  3. version code
  4. version name
  5. app name
  6. paths to each of the APK files (including split APK files)

Using ./adb shell pm list packages -f , I got only package name and the path to the base APK file.
Is it possible to get what I wrote about? Or at least the paths to the split APK files?

@hiteshsahu Using ./adb shell dump doesn't seem to work. It says: "dump: inaccessible or not found" .

Copy link

MrCarb0n commented Jul 23, 2021

How to know installed App's process? like this ↓
Uploading Screenshot_20210723-104444241 (1).jpg…

Copy link

ThatOneCalculator commented Jul 24, 2021

I'm running this from Termux and I'm getting the error: cmd: Failure calling service package: Failed transaction (2147483646)

Copy link

sameerppradhan commented Nov 24, 2021

Need help!
How to get the uses permission on all app installed?

Copy link

wuseman commented Mar 5, 2022

Need help! How to get the uses permission on all app installed?

First, I know the thread is old but for all newcomers who entering the cli nix world of android I just want to say: 'pm' has been moved to become 'cmd' command instead (Call package manager) you might have seen a note on earlier android versions: NOTE: 'pm list' commands have moved! Run 'adb shell cmd package

Back to the real topic and why I came here. @sameerppradhan here is how you can list all permissions for all apps on device, I also toke some time and wrote down some other examples about listning persmissions

Below command will do what you asking for, printing * permissions for all apps installed

cmd package list permissions 
cmd package list permissions|wc -l
Example Output

And some more examples you can use:

Print permissions organized by group
cmd package list permissions -g
Print all information that is given for all aplications
cmd package list permissions -f
Just print short summary of permissions of all applications
cmd package list permissions -s
Print only the flagged permissions that is consider as dangerous for all applications
cmd package list permissions -d
Print only the permissdions the user user you choose to check will see (cmd list users for find users to choose between)
cmd package list permissions -u
  • And you probably already figured it out, if you want to check specifik apps only just add the app name at end of the lines.

- wuseman

Copy link

Ash-Kay commented Aug 31, 2022

For anyone wondering about full command using adb adb shell pm list packages -f worked for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment