feat: save screenshot after action

This commit is contained in:
lilong.129
2025-05-12 17:59:51 +08:00
parent 0722e92e87
commit 9c735bd46a
9 changed files with 72 additions and 50 deletions

View File

@@ -312,7 +312,7 @@ func (ad *ADBDriver) TapAbsXY(x, y float64, opts ...option.ActionOption) error {
if err != nil {
return err
}
defer postHandler(ad, actionOptions)
defer postHandler(ad, ACTION_TapAbsXY, actionOptions)
// adb shell input tap x y
xStr := fmt.Sprintf("%.1f", x)
@@ -331,7 +331,7 @@ func (ad *ADBDriver) DoubleTap(x, y float64, opts ...option.ActionOption) error
if err != nil {
return err
}
defer postHandler(ad, actionOptions)
defer postHandler(ad, ACTION_DoubleTapXY, actionOptions)
// adb shell input tap x y
xStr := fmt.Sprintf("%.1f", x)
@@ -380,7 +380,7 @@ func (ad *ADBDriver) Drag(fromX, fromY, toX, toY float64, opts ...option.ActionO
if err != nil {
return err
}
defer postHandler(ad, actionOptions)
defer postHandler(ad, ACTION_Drag, actionOptions)
duration := 200.0
if actionOptions.Duration > 0 {
@@ -412,7 +412,7 @@ func (ad *ADBDriver) Swipe(fromX, fromY, toX, toY float64, opts ...option.Action
if err != nil {
return err
}
defer postHandler(ad, actionOptions)
defer postHandler(ad, ACTION_Swipe, actionOptions)
// adb shell input swipe fromX fromY toX toY
_, err = ad.runShellCommand(