change: check android device offline

This commit is contained in:
lilong.129
2023-05-30 21:31:51 +08:00
parent 21a2f9fd22
commit b0e7a6609f
3 changed files with 19 additions and 4 deletions
+3
View File
@@ -246,6 +246,9 @@ func (d *Device) ReverseForwardKillAll() error {
func (d *Device) RunShellCommand(cmd string, args ...string) (string, error) {
raw, err := d.RunShellCommandWithBytes(cmd, args...)
if err != nil {
if errors.Is(err, code.AndroidDeviceConnectionError) {
return "", err
}
return "", errors.Wrap(code.AndroidShellExecError, err.Error())
}
return string(raw), nil