Last active
February 28, 2025 04:50
-
-
Save jimmy947788/fda2c3e355c63c76d4732ae91324ad53 to your computer and use it in GitHub Desktop.
use adb command pull latest version apk(s)
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
#!/bin/bash | |
PACKAGE_NAME=$1 | |
VERSION=$(adb shell dumpsys package $PACKAGE_NAME | grep versionName) | |
VERSION=$(echo $VERSION | cut -d'=' -f 2) | |
echo "$PACKAGE_NAME ver:$VERSION" | |
mkdir -p apk | |
mkdir -p apk/$PACKAGE_NAME-$VERSION | |
# 查詢並拉取所有 APK 檔案 | |
APK_PATHS=$(adb shell pm path $PACKAGE_NAME | cut -d':' -f 2) | |
for APK_PATH in $APK_PATHS; do | |
APK_NAME=$(basename $APK_PATH) | |
adb pull $APK_PATH apk/$PACKAGE_NAME-$VERSION/$APK_NAME | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
修正多個split apk 下載