gpt4 book ai didi

javascript - 想要使用 js 文件在 iDevice 中的指定点注入(inject)触摸或点击

转载 作者:行者123 更新时间:2023-12-03 12:18:43 25 4
gpt4 key购买 nike

我能够使用 .js 文件和仪器命令在 iDevice 中启动 ap。 JavaScript 如下:

var target = UIATarget.localTarget();
target.delay(3)
var app = target.frontMostApp()
var win = app.mainWindow()
win.logElementTree();

win.tap();
target.delay(3)

使用上面的 js,我可以在 iDevice 中启动应用程序,但点击仅位于中心。如何传递我自己的点或坐标以便在 iDevice 中进行点击?

还提供一个链接或书籍,可以帮助我进一步编写与屏幕截图或安装/卸载应用程序等相关的自动化的js提前致谢!

最佳答案

这是我入门用的书:http://media.pragprog.com/titles/jptios/find.pdf

如果您想点击窗口上的不同点,可以使用 tapWithOptions({tapOffset:{x:xCoord, y:yCoord}}) 函数。然而,这不一定是实现应用程序自动化的最佳方式。

如果您真的想学习,请查看开发人员文档! https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/InstrumentsUserGuide/UsingtheAutomationInstrument/UsingtheAutomationInstrument.html

关于javascript - 想要使用 js 文件在 iDevice 中的指定点注入(inject)触摸或点击,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24546490/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com