Skip to content

Instantly share code, notes, and snippets.

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

MrCarb0n commented Jul 23, 2021

How to know installed App's process? like this ↓

package.name:process.name
Uploading Screenshot_20210723-104444241 (1).jpg…

@ThatOneCalculator
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)

@sameerppradhan
Copy link

sameerppradhan commented Nov 24, 2021

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

@wuseman
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
1752 
Example Output
 permission:com.samsung.android.app.clockpack.LOCK_PROVIDER
 permission:com.sec.epdgtestapp.permission.SERVICE
 permission:com.samsung.android.mobilservice.MIGRATION_READ
 permission:android.permission.ADJUST_RUNTIME_PERMISSIONS_POLICY
 permission:com.microsoft.appmanager.BIND_CACHE_SERVICE_PERMISSION
 permission:com.samsung.android.app.telephonyui.permission.USE_PHOTORING
 permission:com.samsung.android.bixby.agent.permission.APP_SERVICE
 permission:com.google.android.gms.chromesync.permission.METADATA_UPDATED
 permission:com.samsung.android.mcfds.permission.DISABLE_HANDOFF
 permission:com.sec.android.app.samsungapps.accesspermission.GENERNAL_ACTIVITY
 permission:com.samsung.android.permission.SEM_AUTO_BIND_NOTIFICATION_LISTENER_SERVICE
 .... 

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

@Ash-Kay
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

@JohnLBevan
Copy link

JohnLBevan commented Nov 13, 2022

For finding version info you can run adb shell "dumpsys package packages" which gets all package info; then you'd have to parse the output in your language of choice to pull just the package and versionName info.

@AndroidDeveloperLB
Copy link

AndroidDeveloperLB commented Nov 13, 2022

@JohnLBevan This works, but how exactly do you get the app-name out of it?
Also, what do you mean "parse the output in your language of choice" ? Isn't it always in English? How would you choose a different language ? Please show an example of when it isn't in English, and why.

@JohnLBevan
Copy link

JohnLBevan commented Nov 13, 2022

@JohnLBevan This works, but how exactly do you get the app-name out of it?

Ah sorry - I was describing how to get the package version; not the app.

Also, what do you mean "parse the output in your language of choice" ? Isn't it always in English? How would you choose a different language ? Please show an example of when it isn't in English, and why.

I'm talking programming/scriping/shell language, rather than human language.

@AndroidDeveloperLB
Copy link

AndroidDeveloperLB commented Nov 13, 2022

@JohnLBevan Oh ok.
Do you know perhaps if it's possible to parse any kind of APK file using adb? Maybe it could help with finding the app-name?
I also wonder if there is a way to fetch the app-icon.

@JohnLBevan
Copy link

JohnLBevan commented Nov 22, 2022

Hey @AndroidDeveloperLB I'm afraid I don't know much about adb itself... Best to post questions somewhere like https://android.stackexchange.com/ to get help from the community at large.

@AndroidDeveloperLB
Copy link

AndroidDeveloperLB commented Nov 22, 2022

@JohnLBevan OK thanks.

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