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
|
||||||
|
|
||||||
$devices = adb devices
|
$devices = adb devices
|
||||||
|
if ($devices.Length -eq 2) {
|
||||||
|
throw "No devices found"
|
||||||
|
}
|
||||||
$devices = $devices[1..($devices.length-2)]
|
$devices = $devices[1..($devices.length-2)]
|
||||||
|
|
||||||
[String]$selectedDevice = ''
|
[String]$selectedDevice = ''
|
||||||
if ($devices.Length -eq 0) {throw "No devices found"}
|
if ($devices.Length -eq 1) {
|
||||||
elseif ($devices.Length -eq 1) {
|
|
||||||
$selectedDevice = ($devices | ForEach-Object {$_.split()[0]})[0]
|
$selectedDevice = ($devices | ForEach-Object {$_.split()[0]})[0]
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
Reference in a new issue