Files
shijian/scripts/device.ps1
T

20 lines
484 B
PowerShell
Raw Normal View History

2026-11-26 10:08:04 +08:00
$ErrorActionPreference = 'Stop'
$adbArguments = $args
if ($adbArguments.Count -eq 0) {
$adbArguments = @('devices', '-l')
}
$toolchain = & (Join-Path $PSScriptRoot 'env.ps1')
if (-not (Test-Path -LiteralPath $toolchain.Adb -PathType Leaf)) {
throw "Missing Android platform-tools: $($toolchain.Adb)"
}
Push-Location -LiteralPath $toolchain.Root
try {
& $toolchain.Adb @adbArguments
$deviceExitCode = $LASTEXITCODE
} finally {
Pop-Location
}
exit $deviceExitCode