mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-05 23:51:25 +08:00
修复掉线仍然安装成功的问题
This commit is contained in:
+11
-10
@@ -640,16 +640,17 @@ func (d *Device) InstallAPK(apkPath string, args ...string) (string, error) {
|
|||||||
haserr := func(ret string) bool {
|
haserr := func(ret string) bool {
|
||||||
return strings.Contains(ret, "Failure")
|
return strings.Contains(ret, "Failure")
|
||||||
}
|
}
|
||||||
if d.HasFeature(FeatAbbExec) {
|
// 该方法掉线不会返回error。导致误认为安装成功
|
||||||
raw, err := d.installViaABBExec(apkFile)
|
//if d.HasFeature(FeatAbbExec) {
|
||||||
if err != nil {
|
// raw, err := d.installViaABBExec(apkFile)
|
||||||
return "", fmt.Errorf("error installing: %v", err)
|
// if err != nil {
|
||||||
}
|
// return "", fmt.Errorf("error installing: %v", err)
|
||||||
if haserr(string(raw)) {
|
// }
|
||||||
return "", errors.New(string(raw))
|
// if haserr(string(raw)) {
|
||||||
}
|
// return "", errors.New(string(raw))
|
||||||
return string(raw), err
|
// }
|
||||||
}
|
// return string(raw), err
|
||||||
|
//}
|
||||||
|
|
||||||
remote := fmt.Sprintf("/data/local/tmp/%s.apk", builtin.GenNameWithTimestamp("gadb_remote_%d"))
|
remote := fmt.Sprintf("/data/local/tmp/%s.apk", builtin.GenNameWithTimestamp("gadb_remote_%d"))
|
||||||
err = d.Push(apkFile, remote, time.Now())
|
err = d.Push(apkFile, remote, time.Now())
|
||||||
|
|||||||
Reference in New Issue
Block a user