Created
June 1, 2026 10:43
-
-
Save erikchan002/45ab4755c7c32835f1370999b17ef168 to your computer and use it in GitHub Desktop.
Pull all APKs via adb into directory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if [ -z "$1" ]; then | |
| echo "Error: Package is empty or missing. Example: $0 com.example.app" >&2 | |
| exit 1 | |
| fi | |
| VERSION=$(adb shell dumpsys package $1 | grep versionName | cut -d= -f2 | head -n 1) | |
| DIR="$1-$VERSION" | |
| if [ -n "$2" ]; then | |
| DIR="$2" | |
| fi | |
| mkdir -p "$DIR" | |
| PATHS=$(adb shell pm path $1 | cut -d: -f2) | |
| for path in $PATHS; do | |
| echo "Pulling $path" | |
| adb pull "$path" "$DIR/$(basename "$path")" | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment