为什么我会看到“尝试运行脚本时发生错误。”在 UI 自动化工具中?
当我尝试在 iOS 5 设备上运行 UI 自动化脚本时,出现以下错误:
“尝试运行脚本时发生错误。”
相同的脚本在模拟器或 iOS 4.3.3 设备上完美运行。
我该如何解决这个问题?
When I try to run a UI Automation script on iOS 5 devices I am getting the following error:
"An error occurred while trying to run the script."
The same script is running perfectly in the simulator or on an iOS 4.3.3 device.
How can I solve this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
这应该可以解决这个问题:
This should fix this issue:
在设备上,您应该明确允许运行 UI 自动化脚本。
设置 ->开发人员
启用UI自动化
切换为打开打开该选项后,错误消失了,一切都按预期工作。
On devices you should explicity allow to run UI Automation scripts.
Settings -> Developer
Enable UI Automation
to onAfter turning the option on, the error went away and everything worked as expected.
我会尝试关闭 xcode 并在不运行 xcode 的情况下启动自动化脚本。我遇到了一个问题,该进程附加到 xcode,当我尝试从仪器运行时,xcode 卡在断点/崩溃上,我无法继续。
我建议的解决方案是独立于 xcode 运行 Instruments。
I would try closing xcode and starting the automation script without xcode running. I had an issue where the process was attached to xcode, when I attempted to run from instruments, xcode got stuck on a breakpoint/crash and I couldn't proceed.
The solution I'm proposing is run Instruments independent of xcode.
可能你的机器上有多个 Xcode,要么删除其他的,要么
只需按照以下步骤操作
1 打开 Xcode 并转到其首选项。
2 然后打开位置选项卡
3 在命令行工具中选择您正在使用的 Xcode 版本。该条目可能是错误的
Might be you are having more than one Xcode in your machine either delete others or
Just follow these steps
1 Open Xcode and go to its preferences.
2 Then open Location tab
3 In command line tools select the Xcode version that you are using . it might be possible that this entry is wrong