Skip to content

Instantly share code, notes, and snippets.

@lauritzh
Created January 6, 2023 00:12
Show Gist options
  • Save lauritzh/d6ce160c2f7a2507ffaa94081ed28a5c to your computer and use it in GitHub Desktop.
Save lauritzh/d6ce160c2f7a2507ffaa94081ed28a5c to your computer and use it in GitHub Desktop.
Ever wanted to obtain an APK from an Android device? You do not need to install fancy Apps for this, ADB and the following minimal Bash script is sufficient to do so. Use the App's bundle identifier as first argument.
#!/bin/bash
# Usage: ./download_apks.sh com.example.app
BUNDLE_FILES=$(adb shell pm path "$1")
for file in $BUNDLE_FILES; do
CLEAN=$(echo "$file"|sed 's/[^:]*://')
adb pull "$CLEAN" .
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment