Skip to content

Instantly share code, notes, and snippets.

@gilsouza
Forked from anonymous/download_apk.sh
Last active March 23, 2024 16:52
Show Gist options
  • Save gilsouza/3c695e4357632558e5341e15e9e4c265 to your computer and use it in GitHub Desktop.
Save gilsouza/3c695e4357632558e5341e15e9e4c265 to your computer and use it in GitHub Desktop.
Bash script for pulling APK's from Non-rooted android devices
#!/bin/sh
if test $# -lt 1 ; then
echo "Usage: download_apk.sh <GooglePlayPackageName>"
exit 1
fi
PACKAGE=$1
APK_PATH=`adb shell pm list packages -f -3 | grep $PACKAGE | sed -e 's/package://g;s/='"$PACKAGE"'//g'`
echo "Pulling $APK_PATH from device"
echo `adb pull ${APK_PATH} ./${PACKAGE}.apk`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment