Skip to content

Instantly share code, notes, and snippets.

@robsouth84
Created October 23, 2019 02:37
Show Gist options
  • Save robsouth84/5000c2ab9f55a22ecdff822fbc55399d to your computer and use it in GitHub Desktop.
Save robsouth84/5000c2ab9f55a22ecdff822fbc55399d to your computer and use it in GitHub Desktop.
Some PowerShell one liners to pull apks from a Android device with adb
//find all apps NOT in /data and pull to current dir
$ adb shell "pm list packages -f | cut -d':' -F2 | cut -d'=' -F1 | grep apk$ " | ForEach-Object { adb pull $_ }
//find all apps NOT in /data && NOT in /vendor (likely no access) and pull to current dir
$ adb shell "pm list packages -f | cut -d':' -F2 | cut -d'=' -F1 | grep apk$ | grep -v ^\/vendor" | ForEach-Object { adb pull $_ }
//find all apps in /data and pull to current dir
//this will pull entire package folder not just apk. first this was out of convienience when parsing the strings, but turns out you get some intersting binaries along the way. see facebook for example
$ adb shell "pm list packages -f | cut -d':' -F2 | grep ^\/data | cut -sd 'base.apk' -F1 " | ForEach-Object { adb pull $_ }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment