[英]Why am I seeing “An error occurred while trying to run the script.” in the UI Automation instrument?
When I try to run a UI Automation script on iOS 5 devices I am getting the following error: 当我尝试在iOS 5设备上运行UI Automation脚本时,我收到以下错误:
"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. 相同的脚本在模拟器或iOS 4.3.3设备上运行完美。
How can I solve this problem? 我怎么解决这个问题?
这应该解决这个问题:
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
On devices you should explicity allow to run UI Automation scripts. 在设备上,您应该明确允许运行UI Automation脚本。
Settings -> Developer
转到Settings -> Developer
Enable UI Automation
to on 切换Enable UI Automation
为打开 After turning the option on, the error went away and everything worked as expected. 打开选项后,错误消失了,一切都按预期工作。
Might be you are having more than one Xcode in your machine either delete others or Just follow these steps 您可能在您的机器中有多个Xcode要么删除其他Xcode,要么按照这些步骤操作
1 Open Xcode and go to its preferences. 1打开Xcode并转到其首选项。 2 Then open Location tab 3 In command line tools select the Xcode version that you are using . 2然后打开“位置”选项卡3在命令行工具中,选择您正在使用的Xcode版本。 it might be possible that this entry is wrong 这个条目可能是错误的
I would try closing xcode and starting the automation script without xcode running. 我会尝试关闭xcode并启动自动化脚本而不运行xcode。 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. 我有一个问题,这个过程被附加到xcode,当我试图从仪器运行时,xcode卡在断点/崩溃上,我无法继续。
The solution I'm proposing is run Instruments independent of xcode. 我提出的解决方案是运行独立于xcode的仪器。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.