adbkit icon indicating copy to clipboard operation
adbkit copied to clipboard

Option to only retrieve 3rd party packages and their filenames

Open skhavari opened this issue 11 years ago • 2 comments

currently client.getPackages is equivalent to adb shell pm list packages

need a way to get only 3rd party packages and their package filename on the given device. In other words: adb shell pm list packages -f -3

the full set of options available for list packages is

  • -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.
  • -u: Also include uninstalled packages.
  • --user <USER_ID>: The user space to query.

possible solution:

  • modify client.getPackages to take an options object
options = {
    retrieve_filename: [true | false*],
    filter: [disabled, enabled, system, thirdparty, null*],
    retrieve_installer: [true | false*],
    include_uninstalled_packages: [ true | false*],
    user_id: [<user_id> | null*]
}
  • then need to modify the return value(s) to include the additional filenames

skhavari avatar Oct 06 '14 03:10 skhavari

Is there a workaround?

skhavari avatar Oct 06 '14 03:10 skhavari

Hmm, we might add it at some point, but currently what you can do is this:

client.shell(serial, 'pm list packages -f -3')
  .then(adb.util.readAll)
  .then(function(output) {
    // Manually parse output here
  })

sorccu avatar Oct 06 '14 03:10 sorccu