Go 模拟滑动手机页面 AdbShellInputSwipe

10 min read

Go 模拟滑动手机页面 AdbShellInputSwipe

//模拟滑动
//adb shell input swipe  0 0  600 600
func AdbShellInputSwipe(x1, y1, x2, y2 int) {
    xx1 := strconv.Itoa(x1)
    yy1 := strconv.Itoa(y1)
    xx2 := strconv.Itoa(x2)
    yy2 := strconv.Itoa(y2)
    exec.Command("adb", "shell", "input", "swipe", xx1, yy1, xx2, yy2).Run()
}