简体   繁体   English

更改 UI 测试的模拟器克隆的状态栏

[英]Change status bar of simulator clones for UI tests

When enabling parallel testing in the ui test scheme, Xcode automatically spawns several clones of the simulator that is used for the tests.在 ui 测试方案中启用并行测试时,Xcode 会自动生成用于测试的模拟器的多个克隆。 Additionally my workflow takes screenshots while testing.此外,我的工作流程在测试时会截屏。 I know that I have to use the command xcrun simctl --set testing to interact with cloned simulators (eg to change the status bar).我知道我必须使用命令xcrun simctl --set testing与克隆的模拟器进行交互(例如更改状态栏)。

However, the clones are not booted at the time of the scheme execution but right before the actual testing starts.但是,克隆不会在方案执行时启动,而是在实际测试开始之前启动。 I can't use a pre-action here to change the status bar because at that time the clones do not exist yet.我不能在这里使用预先操作来更改状态栏,因为当时克隆还不存在。

So how can I adjust the status bar of the clones after they've been booted but before the testing starts?那么如何在克隆启动之后但在测试开始之前调整它们的状态栏呢?

Have you tested Test pre-action?你测试过Test pre-action吗?

在方案中测试预动作

Have you tried to launch xcrun with absolute path like this?您是否尝试过使用这样的绝对路径启动 xcrun?

/usr/bin/xcrun simctl

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM