简体   繁体   English

为什么我在UI自动化工具中看到“尝试运行脚本时发生错误。”?

[英]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脚本。

  • Go to Settings -> Developer 转到Settings -> Developer
  • Switch Enable UI Automation to on 切换Enable UI Automation打开

After turning the option on, the error went away and everything worked as expected. 打开选项后,错误消失了,一切都按预期工作。

开发者设置 - 启用UI自动化

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.

相关问题 UI自动化工具中的“尝试运行脚本时发生错误。” - “An error occurred while trying to run the script.” in the UI Automation instrument? 我尝试在ios模拟器上运行示例应用程序时发生错误 - Error occurred while i am trying to run my sample app on ios simulator 在UI自动化工具的脚本中,如何导入另一个脚本? - Within a script in the UI Automation instrument, how do I import another script? 从命令行运行UI自动化工具时出错 - Error when running UI Automation instrument from command line 尝试从jenkins运行UI自动化脚本时出错 - Error when attempting to run UI automation script from jenkins 要在设备上运行的iOS UI自动化脚本 - iOS UI Automation Script to run on device 在为Pebble手表进行开发时,为什么在iOS上的-setAppUUID:上看到错误? - Why am I seeing an error on -setAppUUID: on iOS when developing for the Pebble watch? 为什么我看到有关使用LLVM的-falign-loops的编译错误? - Why am I seeing a compilation error about -falign-loops using LLVM? 将Core Data属性从Integer 16更改为String时,为什么会出现此错误? - Why am I seeing this error when changing a Core Data attribute from Integer 16 to String? 为什么我看到黑屏? 我没有分配东西吗? - Why am I seeing a black screen? Did I not alloc something?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM