Xcode 挂起单元测试

发布于 2025-01-12 22:40:22 字数 236 浏览 1 评论 0原文

我的 iOS 应用程序单元测试处于启动状态。无论在模拟器还是实际设备上启动都是一样的。看起来测试已启动,然后应用程序永远停留在启动图像上,没有任何活动迹象。

有时,当我终止 Xcode 时,第一个单元测试会在重新启动后运行,但随后又会发生同样的情况,挂起所有其他测试:(

使用 Xcode 13.2.1

My unit tests for iOS app are hanging in the launching state. It is the same regardless launching on simulator or actual device. It looks like the test is launched and then app is stuck at the launch image forever without any sign of activity.
Xcode shows testing but nothing happens

Sometimes when I kill Xcode, the first unit test runs after re-launch OK but then it is the same story hanging all other tests :(

using Xcode 13.2.1

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

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

发布评论

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

评论(2

总攻大人 2025-01-19 22:40:22

Xcode 14.3.1 遇到同样的问题,
对我有用的是

测试计划 ->编辑测试计划

在此处输入图像描述

并在选项中 输入
取消选中“并行执行(如果可能)”

在此处输入图像描述

Xcode 14.3.1 get the same issue,
What works for me is

Test Plan -> Edit Test Plan

enter image description here

and in Options
untick "Execute in parallel (if possible)"

enter image description here

方圜几里 2025-01-19 22:40:22

在运行测试之前,请尝试先从设备中删除该应用程序。然后从 XCode 菜单中执行 Product ->清理构建文件夹,产品 ->清洁测试结果,产品 ->建造。接下来,将您的方案更改为测试方案。现在您可以单击“测试导航器”图标(左上角的菱形图标)。您可以通过单击每个测试旁边的菱形图标或单击运行所有测试的顶级图标来选择要运行的测试。

Before running your tests, try first deleting the app from your device. Then from the XCode menu do Product -> Clean Build Folder, Product -> Clean Test Results, Product -> Build. Next, change your Scheme to a Test Scheme. Now you can click on the Test Navigator Icon (top left diamond shape icon). And you can select the tests to run by clicking on the diamond icons next to each test, or by clicking the top-level one that runs all tests.

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