$directoryPath = Get-Location # 获取脚本的执行目录
Get-ChildItem -Path $directoryPath -Filter *.apk | ForEach-Object {
$apkPath = $_.FullName
Write-Host "正在安装 $apkPath"
& adb install $apkPath
}
遍历目录下的子目录
$directoryPath = Get-Location # 获取脚本的执行目录
# 获取目录下及其子目录中的所有.apk文件
Get-ChildItem -Path $directoryPath -Filter *.apk -Recurse | ForEach-Object {
$apkPath = $_.FullName
Write-Host "正在安装 $apkPath"
& adb install $apkPath
}