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

发布于 2024-12-27 22:54:51 字数 193 浏览 3 评论 0原文

当我尝试在 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."

enter image description here

The same script is running perfectly in the simulator or on an iOS 4.3.3 device.

How can I solve this problem?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

半衬遮猫 2025-01-03 22:54:51

这应该可以解决这个问题:

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

This should fix this issue:

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
锦上情书 2025-01-03 22:54:51

在设备上,您应该明确允许运行 UI 自动化脚本。

  • 转到设置 ->开发人员
  • 启用UI自动化切换为打开

打开该选项后,错误消失了,一切都按预期工作。

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

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.

Developer Settings - enable UI Automation

倾听心声的旋律 2025-01-03 22:54:51

我会尝试关闭 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.

债姬 2025-01-03 22:54:51

可能你的机器上有多个 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文