Failed to find a suitable device for the type IBSimDeviceTypeiPad2x 解决方法 - Xcode

1,210 阅读1分钟

现在在用react native开发app,感觉客户端真的坑不少。

今天更新Xcode,就遇上了Build Failed,报Failed to find a suitable device for the type IBSimDeviceTypeiPad2x (com.apple.dt.Xcode.IBSimDeviceType.iPad-2x) with runtime iOS 12.4 (12.4 - 16G73) - com.apple.CoreSimulator.SimRuntime.iOS-12-4 这个错误,以下几个为解决办法

  1. 最有效最简单的办法

杀死所有模拟器进程

$ sudo killall -9 com.apple.CoreSimulator.CoreSimulatorService

设置正确的Xcode路径

$ sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

如果不起作用,重置所有模拟器

$ xcrun simctl erase all

  1. 这种方法不好,因为所有的文件都在node_modules中

找到ios文件夹中所有的findmatchingsimulator.js

if (!version.includes('iOS') && !version.includes('tvOS')) { continue; } 将上面的IOS换为com.apple.CoreSimulator.SimRuntime.iOStvOS换为com.apple.CoreSimulator.SimRuntime.tvOS

  1. 万能卸载大法,但试过对我没起作用

Delete Xcode in Launchpad.

Clean ~/Library/Developer folder.

Open the App Store, the Xcode APP button will be "Open".

Open it.

  1. 最最后不行就重启电脑吧,有时候真的就起作用了