diff --git a/internal/version/VERSION b/internal/version/VERSION index 883634e4..f6049b32 100644 --- a/internal/version/VERSION +++ b/internal/version/VERSION @@ -1 +1 @@ -v5.0.0-beta-2503261906 +v5.0.0-beta-2503271937 diff --git a/uixt/android_driver_adb.go b/uixt/android_driver_adb.go index 893621b9..661a01ec 100644 --- a/uixt/android_driver_adb.go +++ b/uixt/android_driver_adb.go @@ -961,6 +961,14 @@ func (ad *ADBDriver) ClearImages() error { return nil } +func (ad *ADBDriver) ClearFiles(paths ...string) error { + log.Info().Strs("paths", paths).Msg("ADBDriver.ClearFiles") + for _, path := range paths { + _, _ = ad.Device.RunShellCommand("rm", "-rf", path) + } + return nil +} + // PullImages pulls all images from device's DCIM/Camera directory to local directory func (ad *ADBDriver) PullImages(localDir string) error { log.Info().Str("localDir", localDir).Msg("ADBDriver.PullImages") diff --git a/uixt/browser_driver.go b/uixt/browser_driver.go index 75bd9fc1..6afba129 100644 --- a/uixt/browser_driver.go +++ b/uixt/browser_driver.go @@ -448,6 +448,10 @@ func (wd *BrowserDriver) ClearImages() error { return errors.New("not support") } +func (wd *BrowserDriver) ClearFiles(paths ...string) error { + return errors.New("not support") +} + func (wd *BrowserDriver) PushImage(localPath string) error { return errors.New("not support") } diff --git a/uixt/driver.go b/uixt/driver.go index 897bbc76..fbf840fe 100644 --- a/uixt/driver.go +++ b/uixt/driver.go @@ -71,6 +71,9 @@ type IDriver interface { PullImages(localDir string) error ClearImages() error + // files related + ClearFiles(paths ...string) error + // triggers the log capture and returns the log entries StartCaptureLog(identifier ...string) error StopCaptureLog() (result interface{}, err error) diff --git a/uixt/harmony_driver_hdc.go b/uixt/harmony_driver_hdc.go index bec2ba83..29b820c6 100644 --- a/uixt/harmony_driver_hdc.go +++ b/uixt/harmony_driver_hdc.go @@ -297,3 +297,8 @@ func (hd *HDCDriver) ClearImages() error { log.Warn().Msg("ClearImages not implemented in HDCDriver") return nil } + +func (hd *HDCDriver) ClearFiles(paths ...string) error { + log.Warn().Msg("ClearFiles not implemented in HDCDriver") + return nil +} diff --git a/uixt/ios_driver_wda.go b/uixt/ios_driver_wda.go index 8f5e9897..3fa3b9da 100644 --- a/uixt/ios_driver_wda.go +++ b/uixt/ios_driver_wda.go @@ -1002,6 +1002,11 @@ func (wd *WDADriver) ClearImages() error { return err } +func (wd *WDADriver) ClearFiles(paths ...string) error { + log.Warn().Msg("ClearFiles not implemented in WDADriver") + return nil +} + type wdaResponse struct { Status int `json:"status"` SessionID string `json:"sessionId"`