Why am I seeing “An error occurred while trying to run the script.” in the UI Automation instrument?

被刻印的时光 ゝ 提交于 2019-11-30 17:46:24
user1751511

This should fix this issue:

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

On devices you should explicity allow to run UI Automation scripts.

  • Go to Settings -> Developer
  • Switch Enable UI Automation to on

After turning the option on, the error went away and everything worked as expected.

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.

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!