我们可以将 UI 自动化工具与 iPhone 模拟器结合使用吗?
我一直在使用带有 Instruments 和 iPhone SDK 4.0 的新 UI 自动化工具,但到目前为止我还无法让它在 iPhone Simulator 下运行。我尝试将目标设置为每个可能的位置(我的构建文件夹、~/Library/Application Support/iPhone Simulator 中的应用程序文件夹等),但当我尝试运行它时收到一条错误消息:
-[UIATarget_0x5a1e3b0 frontMostApp] 中出现意外错误,/SourceCache/UIAutomation_Sim/UIAutomation-37/Framework/UIATargetElements.m 第 437 行,
有人让它工作吗?
I’ve been using the new UI automation tools with Instruments and the iPhone SDK 4.0, but so far I haven’t been able to get it to run under the iPhone Simulator. I’ve tried setting the target to every location possible—my build folder, the app folder in ~/Library/Application Support/iPhone Simulator, etc.—but I get an error message when I try to run it:
Unexpected error in -[UIATarget_0x5a1e3b0 frontMostApp], /SourceCache/UIAutomation_Sim/UIAutomation-37/Framework/UIATargetElements.m line 437,
Has anyone gotten this to work?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,理论上可以。实践中存在很多问题。但是你检查过模拟器是否有accessibility.plist吗?
我在 https://devforums.apple.com/message/261883#261883
他们建议:“将 ~/Library/Application Support/iPhone Simulator/4.0/Library/Preferences/com.apple.Accessibility.plist 复制到 ~/Library/Application Support/iPhone Simulator/4.0.1/Library/Preferences”并且它有效为我。
Yes in theory you can. In practice there are a lot of problems. But did you check if simulator has the accessibity.plist?
I found this on https://devforums.apple.com/message/261883#261883
they recommend: "Copy ~/Library/Application Support/iPhone Simulator/4.0/Library/Preferences/com.apple.Accessibility.plist to ~/Library/Application Support/iPhone Simulator/4.0.1/Library/Preferences" and it worked for me.
如果您无法获得正确的目标,则使用不同的工具(例如 Leaks)运行您的项目应该将您的可执行文件放入“选择目标”列表中。这至少是您可以通过这种方式排除的一个潜在错误源。
If you have trouble getting the correct target, running your project with a different instrument (like Leaks) should put your executable into the "choose target" list. That is at least one potential error source you can exclude that way.