修复控制功能
This commit is contained in:
@@ -17,7 +17,7 @@ from Entity.ResultData import ResultData
|
||||
from Utils.ControlUtils import ControlUtils
|
||||
from Utils.ThreadManager import ThreadManager
|
||||
from script.ScriptManager import ScriptManager
|
||||
from Entity.Variables import addModelToAnchorList
|
||||
from Entity.Variables import addModelToAnchorList, wdaFunctionPort
|
||||
import Entity.Variables as ev
|
||||
from Utils.JsonUtils import JsonUtils
|
||||
|
||||
@@ -185,7 +185,7 @@ def launchApp():
|
||||
def toHome():
|
||||
body = request.get_json()
|
||||
udid = body.get("udid")
|
||||
client = wda.USBClient(udid)
|
||||
client = wda.USBClient(udid, wdaFunctionPort)
|
||||
client.home()
|
||||
return ResultData(data="").toJson()
|
||||
|
||||
@@ -195,7 +195,10 @@ def toHome():
|
||||
def tapAction():
|
||||
body = request.get_json()
|
||||
udid = body.get("udid")
|
||||
client = wda.USBClient(udid)
|
||||
client = wda.USBClient(udid, wdaFunctionPort)
|
||||
print("-----------------------")
|
||||
print(client)
|
||||
print("-----------------------")
|
||||
session = client.session()
|
||||
session.appium_settings({"snapshotMaxDepth": 0})
|
||||
x = body.get("x")
|
||||
@@ -210,7 +213,7 @@ def swipeAction():
|
||||
body = request.get_json()
|
||||
udid = body.get("udid")
|
||||
direction = body.get("direction")
|
||||
client = wda.USBClient(udid)
|
||||
client = wda.USBClient(udid, wdaFunctionPort)
|
||||
session = client.session()
|
||||
session.appium_settings({"snapshotMaxDepth": 0})
|
||||
|
||||
@@ -232,7 +235,7 @@ def longPressAction():
|
||||
udid = body.get("udid")
|
||||
x = body.get("x")
|
||||
y = body.get("y")
|
||||
client = wda.USBClient(udid)
|
||||
client = wda.USBClient(udid, wdaFunctionPort)
|
||||
session = client.session()
|
||||
session.appium_settings({"snapshotMaxDepth": 5})
|
||||
session.tap_hold(x, y, 1.0)
|
||||
@@ -375,7 +378,7 @@ def addTempAnchorData():
|
||||
def getChatTextInfo():
|
||||
data = request.get_json()
|
||||
udid = data.get("udid")
|
||||
client = wda.USBClient(udid)
|
||||
client = wda.USBClient(udid, wdaFunctionPort)
|
||||
session = client.session()
|
||||
xml = session.source()
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user