@echo off
setlocal enabledelayedexpansion
set "input_file=packages.txt"
set "output_dir=apks"
if not exist "%output_dir%" mkdir "%output_dir%"
for /f "usebackq delims=" %%i in ("%input_file%") do (
set "package=%%i"
rem Execute adb shell pm path to get package path
for /f "tokens=*" %%s in ('adb shell pm path "!package!"') do (
set "output=%%s"
set "output=!output:package:=!"
rem Replace slashes with underscores in output filename
set "output_filename=!output:/=_!"
echo !output!
set "target_path=%output_dir%\!output_filename!"
echo "%output_dir%"
rem Execute adb pull with the obtained path and target filename
adb pull "!output!" "!target_path!"
)
)
endlocal
批处理脚本 bat cmd 批量提取安卓应用
于 2023-08-17 15:41:31 首次发布