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