在我的 VTS 主机端 Python 测试脚本中,我似乎找不到在变量上输入触摸屏点击的正确格式。对于输入文本,它可以使用 .format,但这次也效果不佳
x = 528
y = 1270
coord = 528 1270
device.shell('input touchscreen tap x y')
device.shell('input touchscreen tap coord')
我尝试使用单个变量,或定义每个 x 和 y,但如果格式错误,这对我没有任何帮助。
正确的格式是 f 字符串:
adb.shell(f'input touchscreen tap {Center_x} {Center_y}')