add try catch for shell command
This commit is contained in:
@@ -1022,13 +1022,17 @@ class CommandorPage {
|
||||
|
||||
async enableDisableAirPlanMode() {
|
||||
logWithDevice("will enable airplane mode", this.device)
|
||||
await this.device.shell("cmd connectivity airplane-mode enable")
|
||||
// await this.device.shell("adb shell settings put global airplane_mode_on 1")
|
||||
await delay(1000)
|
||||
// await this.device.shell("adb shell settings put global airplane_mode_on 0")
|
||||
await this.device.shell("cmd connectivity airplane-mode disable")
|
||||
await delay(2000)
|
||||
|
||||
try {
|
||||
await this.device.shell("cmd connectivity airplane-mode enable")
|
||||
// await this.device.shell("adb shell settings put global airplane_mode_on 1")
|
||||
await delay(1000)
|
||||
// await this.device.shell("adb shell settings put global airplane_mode_on 0")
|
||||
await this.device.shell("cmd connectivity airplane-mode disable")
|
||||
await delay(2000)
|
||||
} catch (e) {
|
||||
await this.device.shell("cmd connectivity airplane-mode disable")
|
||||
console.log(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user