【问题标题】:xcodebuild tests on a clone devicexcodebuild 在克隆设备上进行测试
【发布时间】:2020-04-29 06:54:27
【问题描述】:

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

# $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 xcrun


    【解决方案1】:
    xcodebuild -disable-concurrent-destination-testing
    

    这会禁用克隆。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-09-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多