Quantcast
Channel: Active questions tagged adb - Android Enthusiasts Stack Exchange
Viewing all articles
Browse latest Browse all 357

Obtain package name AND common name of apps via ADB

$
0
0

I'm looking for a possibility to retrieve both, the package names and the common names of apps installed on an Android device via ADB – or at least to retrieve the common name if the package name is known. A quick search on our site brought up two related questions, but they don't solve my issue:

I'm looking for a way to retrieve the information directly from the device, if possible – not "any" way (including "web lookups" or "via an app") as those two questions have it.

I know there are multiple tools available to obtain package details:

  • adb dumpsys package: While this lists all packages with a bunch of details, the "common name" is not shown
  • adb shell pm list: only gives the package names
  • aapt would be able to obtain the common name, but would require to first pull the .apk file from the device, which is not really convenient (and obviously will be pretty slow with many and/or large apps installed)

Did I miss something? I know the information must be on the device (how else could it show the app names in the GUI? I doubt Android parses the .apk file each time the GUI need the "common name"). So is there a way to get hold of it, using ADB directly?


TL;DR

Background (if somebody's curious): I want to be able to quickly obtain a list of user-apps from any of my devices, without having to revert to acrobatics. A list of their package names I can retrieve using adb shell pm list -3, but as those are package names only, recognizing apps is a guess-work. So if there were some ADB command to retrieve the common name for a given package name, I could simply use a loop like for pkg in $(adb shell pm list -3); do echo "- $(adb <whatever_the_command_is> $pkg) ($pkg)"; done– and get a listing of all the installed user-apps in a "human readable format" together with their package names.

Use-cases:

  • See what "superflous" apps are installed (which I could remove)
  • Cross-check lists from multiple devices
  • Documentation ;)
  • and probably more (but the above 3 are what I need it for)

Viewing all articles
Browse latest Browse all 357

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>