【问题标题】:Cannot create new Simulator in Xcode无法在 Xcode 中创建新的模拟器
【发布时间】:2021-05-14 03:46:25
【问题描述】:

我正在尝试在旧版本的 iOS (11.0) 上测试我的应用。

  1. 在 Xcode 的“设置活动方案”-选择器中按“添加其他模拟器”

  1. 点击操作系统版本下拉菜单中的“下载更多模拟器运行时...”。

  1. 下载 iOS 11.0 运行时。 (也可以通过导航到 Xcode 设置 -> 组件 -> 模拟器来查看)

完成此操作后,我希望 iOS 11.0 可以在图像 2 的“操作系统版本”下拉列表中看到,但事实并非如此。它看起来与图像 2 完全相同。当关闭 Xcode 并重新启动我的 Mac 并返回时在运行时列表中,它看起来仍然与图 3 上的完全一样。运行时已下载,但我无法将其创建为模拟器。

下载运行时后,当运行时没有出现在“创建模拟器”对话框中时,如何创建新的模拟器?

【问题讨论】:

    标签: ios xcode ios-simulator


    【解决方案1】:

    在控制台中运行 xcrun simctl list runtimes 会显示当前安装了哪些运行时。这是我目前系统上的外观:

    == Runtimes ==
    iOS 11.0 (11.0.1 - 15A8401) - com.apple.CoreSimulator.SimRuntime.iOS-11-0 (unavailable, The iOS 11.0 simulator runtime is not supported on hosts after macOS 10.15.99.)
    iOS 11.1 (11.1 - 15B87) - com.apple.CoreSimulator.SimRuntime.iOS-11-1 (unavailable, The iOS 11.1 simulator runtime is not supported on hosts after macOS 10.15.99.)
    iOS 11.4 (11.4 - 15F79) - com.apple.CoreSimulator.SimRuntime.iOS-11-4
    iOS 12.0 (12.0 - 16A366) - com.apple.CoreSimulator.SimRuntime.iOS-12-0
    iOS 14.4 (14.4 - 18D46) - com.apple.CoreSimulator.SimRuntime.iOS-14-4
    tvOS 14.3 (14.3 - 18K559) - com.apple.CoreSimulator.SimRuntime.tvOS-14-3
    watchOS 7.2 (7.2 - 18S561) - com.apple.CoreSimulator.SimRuntime.watchOS-7-2
    

    问题解释如下:(unavailable, The iOS 11.0 simulator runtime is not supported on hosts after macOS).. 事实证明:

    当前版本的 macOS 并不支持所有可供下载的运行时

    我无法找到官方参考,说明哪些模拟器支持哪些操作系统...

    【讨论】:

      【解决方案2】:

      在安装组件后,您不会将它们自动添加到模拟器列表中吗?

      我从来不需要像这样创建模拟器。通常下载组件就足够了。有时您可能需要选中“显示为运行目标”复选标记才能将其显示在运行列表中。

      【讨论】:

      • 不,我没有 :( 另外,我无法选中“显示为运行目标”复选标记,因为新添加的模拟器根本没有出现在模拟器列表中。
      • 你能在控制台的xcrun simctl list runtimes列表中看到iOS 11吗?使用xcrun simctl list 检查所有模拟器也可能很有用。
      • 感谢@ScorpiCon,它提供了有用的见解。我已经为我的问题添加了答案。
      猜你喜欢
      • 2017-11-08
      • 1970-01-01
      • 1970-01-01
      • 2019-05-08
      • 1970-01-01
      • 2021-07-24
      • 2016-12-12
      • 1970-01-01
      • 2021-05-21
      相关资源
      最近更新 更多