Fix adb no devices detection
now throws when there are no devices connected
This commit is contained in:
parent
b7dbfcdd0c
commit
1ed0e6e7ec
1 changed files with 4 additions and 2 deletions
|
@ -220,11 +220,13 @@ function main {
|
|||
# devices
|
||||
|
||||
$devices = adb devices
|
||||
if ($devices.Length -eq 2) {
|
||||
throw "No devices found"
|
||||
}
|
||||
$devices = $devices[1..($devices.length-2)]
|
||||
|
||||
[String]$selectedDevice = ''
|
||||
if ($devices.Length -eq 0) {throw "No devices found"}
|
||||
elseif ($devices.Length -eq 1) {
|
||||
if ($devices.Length -eq 1) {
|
||||
$selectedDevice = ($devices | ForEach-Object {$_.split()[0]})[0]
|
||||
}
|
||||
else {
|
||||
|
|
Reference in a new issue