Skip to content

Instantly share code, notes, and snippets.

@inlacou
Last active December 16, 2021 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save inlacou/ae9c480e2b2082ca1f78134ace947439 to your computer and use it in GitHub Desktop.
Save inlacou/ae9c480e2b2082ca1f78134ace947439 to your computer and use it in GitHub Desktop.
[Android][ADB] list installed packages
ALL:
adb shell pm list packages -f
FILTER:
adb shell pm list packages -f | grep inlacou
@inlacou
Copy link
Author

inlacou commented Dec 16, 2021

List all with their version name:
for p in adb shell pm list package | awk -F"package:" '{print $2}'; do echo -n "$p: "; adb shell dumpsys package $p | grep -i versionName | awk -F"=" '{print $2}'; done

@inlacou
Copy link
Author

inlacou commented Dec 16, 2021

List all with requested and given permissions:
for p in adb shell pm list package | awk -F"package:" '{print $2}'; do echo -n "$p: "; adb shell dumpsys package $p | grep -i permission; done

@inlacou
Copy link
Author

inlacou commented Dec 16, 2021

List all with versionCode:
for p in adb shell pm list package | awk -F"package:" '{print $2}'; do echo -n "$p: "; adb shell dumpsys package $p | grep -i versionCode; done
List all filtered with versionCode (just added the | grep inlacou ):
for p in adb shell pm list package | grep inlacou | awk -F"package:" '{print $2}'; do echo -n "$p: "; adb shell dumpsys package $p | grep -i versionCode; done

@inlacou
Copy link
Author

inlacou commented Dec 16, 2021

Get versionCode from apk:
~/Android/Sdk/build-tools/30.0.2/aapt2 dump badging actia.sample.20.8.9.435v7a.apk | grep versionCode | awk -F" " '{print $3}'

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