xcodebuild在克隆设备上进行测试



我正在尝试运行一个模拟器,修改它的外观,设置状态栏,最后在它上运行测试。

# $UUID is an existing simulator in the CoreSimulator/Devices folder
$ Boot up an existing simulator
xcrun simctl boot $UUID
# Amend appearance to dark
xcrun simctl ui booted appearance "dark"
# Set status bar
xcrun simctl status_bar booted override --time "09:41" --cellularMode 'active' --operatorName 'Test'

这将使用正确的修改/状态栏正确启动正确的模拟器。

# Execute the test on the prepared simulator
xcodebuild -scheme $schemeName -project $projectName  -derivedDataPath '/tmp/TestDerivedData/' -destination "platform=iOS Simulator,id=$UUID" build test

不幸的是,xcodebuild创建了模拟器的克隆,并在克隆上运行测试:

SimDevice: Clone 1 of iPhone 8 Plus (463C36F0-2E89-4E51-B59A-4F8EB20F124C, iOS 13.4)

克隆的模拟器确实具有原始模拟器的设置外观,但没有设置状态栏。

问题:我可以阻止xcodebuild启动克隆并在准备好的模拟器上进行测试吗?如果没有,我可以在运行测试之前修改克隆模拟器的外观吗?

xcodebuild -disable-concurrent-destination-testing

这将禁用克隆。

最新更新