临时提交

This commit is contained in:
2025-10-22 19:17:52 +08:00
parent 855a19873e
commit 2310333a60
4 changed files with 20 additions and 33 deletions

View File

@@ -197,9 +197,6 @@ def tapAction():
body = request.get_json()
udid = body.get("udid")
client = wda.USBClient(udid, wdaFunctionPort)
print("-----------------------")
print(client)
print("-----------------------")
session = client.session()
session.appium_settings({"snapshotMaxDepth": 0})
x = body.get("x")
@@ -213,19 +210,17 @@ def tapAction():
def swipeAction():
body = request.get_json()
udid = body.get("udid")
direction = body.get("direction")
duration = body.get("duration") # 时长
sx = body.get("sx") # 起始X点
sy = body.get("sy") # 起始Y点
ex = body.get("ex") # 结束X点
ey = body.get("ey") # 结束Y点
client = wda.USBClient(udid, wdaFunctionPort)
session = client.session()
session.appium_settings({"snapshotMaxDepth": 0})
if direction == 1:
session.swipe_up()
elif direction == 2:
session.swipe_left()
elif direction == 3:
session.swipe_down()
else:
session.swipe_right()
session.swipe(sx, sy, ex, ey, duration)
return ResultData(data="").toJson()