【问题标题】:Error: Can't find a simulator to match with "iPhone 6s"错误:找不到与“iPhone 6s”匹配的模拟器
【发布时间】:2019-11-15 11:51:05
【问题描述】:

几周前,Detox 工作正常 - 据我所知,我没有更新任何内容,现在我在尝试测试时不断收到以下错误(它构建良好):

Error: Can't find a simulator to match with "iPhone 6s", run 'xcrun simctl list' to list your supported devices.
      It is advised to only state a device type, and not to state iOS version, e.g. "iPhone 7"
    at AppleSimUtils.findDevicesUDID (/Users/user/Documents/work/app/e2e/node_modules/detox/src/devices/ios/AppleSimUtils.js:47:13)
    at process._tickCallback (internal/process/next_tick.js:68:7)

如果我运行 applesimutils --list --byName "iPhone 6s" 它会显示 2 个设备:

[
  {
    "deviceType" : {
      "name" : "iPhone 6s",
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Library\/Developer\/CoreSimulator\/Profiles\/DeviceTypes\/iPhone 6s.simdevicetype",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-6s"
    },
    "state" : "Shutdown",
    "isAvailable" : true,
    "name" : "iPhone 6s",
    "udid" : "A87C2EF9-95D2-4562-99BE-E1A39A63ABB1",
    "os" : {
      "buildversion" : "17B102",
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Library\/Developer\/CoreSimulator\/Profiles\/Runtimes\/iOS.simruntime",
      "isAvailable" : true,
      "name" : "iOS 13.2",
      "identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-13-2",
      "version" : "13.2.2"
    }
  },
  {
    "deviceType" : {
      "name" : "iPhone 6s",
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Library\/Developer\/CoreSimulator\/Profiles\/DeviceTypes\/iPhone 6s.simdevicetype",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-6s"
    },
    "state" : "Shutdown",
    "isAvailable" : true,
    "name" : "iPhone 6s",
    "udid" : "F5A2C1D3-5416-431C-A9B5-6054A238283D",
    "os" : {
      "buildversion" : "16E226",
      "bundlePath" : "\/Library\/Developer\/CoreSimulator\/Profiles\/Runtimes\/iOS 12.2.simruntime",
      "isAvailable" : true,
      "name" : "iOS 12.2",
      "identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-12-2",
      "version" : "12.2"
    }
  }
]

我尝试通过 xcode 和 xcrun 添加和删除模拟器,但似乎没有任何效果。

版本:

Mac 10.14.6 applesimutils 版本 0.7.6 排毒 14.3.4 xcode 11.2.1

【问题讨论】:

  • 确保您使用的是最新的 applesimutils 并且正确指定了查询。

标签: ios simulator detox xcrun applesimutils


【解决方案1】:

尝试将 Detox 升级到最新版本(14.7.1,截至 2019 年 11 月 15 日),一个月前在14.5.0 发布的aa250258 中修复了模拟器选择逻辑。

【讨论】:

  • 感谢@noomorph 修复它!!!!可能值得将此添加到更改日志/文档中,以便其他用户了解它:)
  • @smj2393 如果答案有帮助,请将其标记为已接受。我们的文档始终针对最新版本的 Detox。
猜你喜欢
  • 2023-03-15
  • 2017-05-28
  • 2015-12-06
  • 1970-01-01
  • 2012-04-05
  • 2020-10-31
  • 1970-01-01
相关资源
最近更新 更多