Skip to content

Instantly share code, notes, and snippets.

@cabiamdos
Created April 22, 2025 12:11
Show Gist options
  • Save cabiamdos/cbe8feaa3a289ef9ffb84f78a2877be3 to your computer and use it in GitHub Desktop.
Save cabiamdos/cbe8feaa3a289ef9ffb84f78a2877be3 to your computer and use it in GitHub Desktop.
powershell script for backing up your android apk files
# Get list of installed packages with file paths
$packages = adb shell pm list packages -f
# Loop through each line
foreach ($line in $packages) {
# Extract APK path and package name
if ($line -match "package:(.+\.apk)=(.+)") {
$apkPath = $matches[1]
$packageName = $matches[2]
Write-Host "Backing up: $packageName from $apkPath"
# Pull APK to current folder
adb pull $apkPath "$packageName.apk"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment