无法排毒找到iPhone X或早于iPhone 11的模拟器

时间:2019-09-24 20:42:34

标签: detox

在接受XCode的许可以升级到iOS 13和iPhone 11后得到此错误。我在使用“ iPhone 11”作为排毒配置名称名称的iPhone 11设备上运行排毒测试没有问题。

错误:找不到与“ iPhone X”匹配的模拟器,请运行“ xcrun simctl list”以列出您支持的设备。        建议仅声明设备类型,而不声明iOS版本,例如“ iPhone 7”```

运行xcrun simctl list,并且iPhone X确实在那里并已启动:

iPhone 4s (com.apple.CoreSimulator.SimDeviceType.iPhone-4s)
iPhone 5 (com.apple.CoreSimulator.SimDeviceType.iPhone-5)
iPhone 5s (com.apple.CoreSimulator.SimDeviceType.iPhone-5s)
iPhone 6 Plus (com.apple.CoreSimulator.SimDeviceType.iPhone-6-Plus)
iPhone 6 (com.apple.CoreSimulator.SimDeviceType.iPhone-6)
iPhone 6s (com.apple.CoreSimulator.SimDeviceType.iPhone-6s)
iPhone 6s Plus (com.apple.CoreSimulator.SimDeviceType.iPhone-6s-Plus)
iPhone SE (com.apple.CoreSimulator.SimDeviceType.iPhone-SE)
iPhone 7 (com.apple.CoreSimulator.SimDeviceType.iPhone-7)
iPhone 7 Plus (com.apple.CoreSimulator.SimDeviceType.iPhone-7-Plus)
iPhone 8 (com.apple.CoreSimulator.SimDeviceType.iPhone-8)
iPhone 8 Plus (com.apple.CoreSimulator.SimDeviceType.iPhone-8-Plus)
iPhone X (com.apple.CoreSimulator.SimDeviceType.iPhone-X)
iPhone Xs (com.apple.CoreSimulator.SimDeviceType.iPhone-XS)
iPhone Xs Max (com.apple.CoreSimulator.SimDeviceType.iPhone-XS-Max)
iPhone Xʀ (com.apple.CoreSimulator.SimDeviceType.iPhone-XR)
iPhone 11 (com.apple.CoreSimulator.SimDeviceType.iPhone-11)
iPhone 11 Pro (com.apple.CoreSimulator.SimDeviceType.iPhone-11-Pro)
iPhone 11 Pro Max (com.apple.CoreSimulator.SimDeviceType.iPhone-11-Pro-Max)
...
```-- iOS 12.2 --
    iPhone 5s (B9F8AD52-F3A4-4E5A-B6EC-406827678E41) (Shutdown) 
    iPhone 6 Plus (D5C54611-B44F-4F42-A400-FA6B3F10877A) (Shutdown) 
    iPhone 6 (E29542E6-163D-4ABD-8825-78975A22934D) (Shutdown) 
    iPhone 6s (B6D65541-1EB4-43A7-B738-28A215AE50D4) (Shutdown) 
    iPhone 6s Plus (C1C0488F-7810-4552-B404-F344D36B1215) (Shutdown) 
    iPhone 7 (7A5DDC90-60BD-4B9A-9CEC-62C924EB86DF) (Shutdown) 
    iPhone 7 Plus (D19DABA8-AA67-454D-904E-760D202A148A) (Shutdown) 
    iPhone 8 (37F662FE-7368-46E2-AE87-4C1EC561DB07) (Shutdown) 
    iPhone 8 Plus (E7F29F60-E1E3-4206-875C-CE0CD0FDD2B5) (Shutdown) 
    iPhone X (13DD7A53-D818-444D-A537-633365C9DFA8) (Booted) ```
Did detox drop support for running against other iPhone simulators?

I've updated applesimutils and removed and re-added the iPhone X device with iOS version 12.2, but still same error.

4 个答案:

答案 0 :(得分:0)

我在排毒14.3.4中看到了相同的行为。我假设这是您使用的Detox版本。

答案 1 :(得分:0)

在这里为我修复:https://github.com/wix/Detox/issues/1675

此处也提供Coyping解决方案: “在Detox配置中将模拟器的名称设置为“ iPhone 5s,iOS 11.3”与“ iPhone 5s”对我来说已经修复了。Detox的AppleSimUtils.js中的deviceInfo.newestRuntime.version会返回最新的OS版本,即使是否该版本是否存在模拟器。”

答案 2 :(得分:0)

Detox最近在package.json中更新了新的设备选择API。请迁移到该地址。

答案 3 :(得分:0)

我也遇到过这个问题并使用以下命令解决了它。

  1. brew tap wix/brew
  2. brew install applesimutils

另外,我使用的是 XCode 12.4 和 detox 18.7.1。