Code Monkey home page Code Monkey logo

Comments (3)

adolli avatar adolli commented on May 3, 2024

我给你个例子看下合不合适,因为连续移动这种不是必须的,所以没有集成到框架核心里。

假设你是用摇杆进行移动的,且地图平坦无遮挡,而且也集成了poco-sdk

points = [(100, 100), (100, 200), (200, 250)]  # 地图上的点
directions = [(p[i + 1][0] - p[i][0], p[i + 1][0] - p[i][0]) for i in range(len(points) - 1)]  # 连续移动的向量
for v in directions:
    poco('摇杆').swipe(v, duration=v[0] * v[0] + v[1] * v[1])  # 距离越远持续时间越长

以上是一个很简单的例子,实际情况地形可能很复杂我不确定,可参考示例代码的写法。

from airtest.

Meteorix avatar Meteorix commented on May 3, 2024

@gegelaopiaoke 可以贴一下你的连续移动是怎么写的吗?

from airtest.

Meteorix avatar Meteorix commented on May 3, 2024

@gegelaopiaoke 你好,目前版本已经提供了MotionEvent,可以自己封装任意操作

https://github.com/AirtestProject/Airtest/blob/master/playground/android_motionevents.py

from airtest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.