mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-12 02:21:29 +08:00
fix: replace adb with gadb shell command
This commit is contained in:
@@ -1 +1 @@
|
||||
v5.0.0+2412081512
|
||||
v5.0.0+2412101027
|
||||
|
||||
@@ -17,7 +17,6 @@ import (
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/httprunner/funplugin/myexec"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/rs/zerolog/log"
|
||||
|
||||
@@ -797,7 +796,7 @@ func (ad *adbDriver) StopCaptureLog() (result interface{}, err error) {
|
||||
log.Info().Msg("action log is null, use action file >>>")
|
||||
logFilePathPrefix := fmt.Sprintf("%v/data", config.ActionLogFilePath)
|
||||
files := []string{}
|
||||
myexec.RunCommand("adb", "-s", ad.adbClient.Serial(), "pull", config.DeviceActionLogFilePath, config.ActionLogFilePath)
|
||||
ad.adbClient.RunShellCommand("pull", config.DeviceActionLogFilePath, config.ActionLogFilePath)
|
||||
err = filepath.Walk(config.ActionLogFilePath, func(path string, info fs.FileInfo, err error) error {
|
||||
// 只是需要日志文件
|
||||
if ok := strings.Contains(path, logFilePathPrefix); ok {
|
||||
|
||||
@@ -362,7 +362,8 @@ func (dev *AndroidDevice) StopPcap() string {
|
||||
}
|
||||
|
||||
func (dev *AndroidDevice) Uninstall(packageName string) error {
|
||||
return myexec.RunCommand("adb", "-s", dev.SerialNumber, "uninstall", packageName)
|
||||
_, err := dev.d.RunShellCommand("uninstall", packageName)
|
||||
return err
|
||||
}
|
||||
|
||||
func (dev *AndroidDevice) Install(apkPath string, options ...InstallOption) error {
|
||||
@@ -689,6 +690,7 @@ func (l *AdbLogcat) CatchLogcat(filter string) (err error) {
|
||||
return nil
|
||||
}
|
||||
|
||||
// FIXME: replace with gadb shell command
|
||||
// clear logcat
|
||||
if err = myexec.RunCommand("adb", "-s", l.serial, "shell", "logcat", "-c"); err != nil {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user