我正在运行版本 15.4 (15F31d)。昨天我安装了更新,再次打开 XCode,出现一条类似“模拟器需要更新”的消息。我点击了“确定”,什么也没发生。现在,我所有的模拟器都消失了,我无法将它们找回来。我已经重新启动了 XCode 以及我的电脑。
在这里,在安装更新之前,我可以选择不同的模拟器
这就是我单击“管理运行目的地...”时的样子。他们都选择“显示运行目的地:始终”
在
Product - Destination
菜单下,我选择了 Show all run destinations
。
我不明白的是,我可以启动模拟器应用程序
但是XCode无法识别任何模拟器...
当我连接 iPhone 时,它没有显示在这里
但我可以在这里看到它
我也尝试从命令行运行它
$ xcrun simctl list devices
这给了我
iPhone Xs (6723AC4A-4B19-46F5-BAE5-6C3DF2BC253B) (Shutdown)
iPhone SE (3rd generation) (CA9C9B3E-B542-412C-B845-71A0B7D9D797) (Booted)
iPhone SE (3rd generation) (DB2FF536-D849-4786-B3BD-8FB7068F212A) (Shutdown)
iPhone 15 (B039DEC7-D015-4313-A7D9-2CB2324E232B) (Shutdown)
iPhone 15 Plus (797BBF51-A7A9-4F41-A532-424B775AB14D) (Shutdown)
iPhone 15 Pro (36E9933C-D4FB-4818-B4EA-F3ADE9BC5AFF) (Shutdown)
iPhone 15 Pro Max (4CDB180C-79F2-4827-B2AB-256F1812FE98) (Shutdown)
iPad Air (5th generation) (AE3E77BB-137D-42EC-B2C0-2179320216F6) (Shutdown)
iPad (10th generation) (8FD9CB57-CEBA-4570-B7F0-FDEFAAF20683) (Shutdown)
iPad mini (6th generation) (0B6E1473-1864-49B0-BB91-4A2C4F692424) (Shutdown)
iPad Pro (11-inch) (4th generation) (6B9E5069-A52A-4772-96D9-68FFCF496BEC) (Shutdown)
iPad Pro (12.9-inch) (6th generation) (1E45FFF9-E844-4EFC-9938-59C80F8721D7) (Shutdown)
然后我就跑
$ yarn ios --udid "CA9C9B3E-B542-412C-B845-71A0B7D9D797"
返回的
error Failed to build iOS project. "xcodebuild" exited with error code '70'. To debug build logs further, consider building your app with Xcode.app, by opening 'Foo.xcworkspace'.
Command line invocation:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace Foo.xcworkspace -configuration Debug -scheme Foo -destination id=CA9C9B3E-B542-412C-B845-71A0B7D9D797
User defaults from command line:
IDEPackageSupportUseBuiltinSCM = YES
2024-07-25 15:38:32.989 xcodebuild[2255:51186] Writing error result bundle to /var/folders/_j/5k_qtwqn5k39srgfty_40xmc0000gp/T/ResultBundle_2024-25-07_15-38-0032.xcresult
xcodebuild: error: Unable to find a destination matching the provided destination specifier:
{ id:CA9C9B3E-B542-412C-B845-71A0B7D9D797 }
Ineligible destinations for the "Foo" scheme:
{ platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device, error:iOS 17.5 is not installed. To use with Xcode, first download and install the platform }
error Command failed with exit code 1.
为什么我无法再在模拟器上运行我的应用程序?我的
iOS Deployment target
设置为 13
...
模拟器和SDK之间是有区别的。你已经有了模拟器;你已经证明了这一点。您“没有”的是 SDK。这就是小弹出窗口要求您下载的内容(使用它显示的“获取”按钮)。所以点击那个按钮!下载可能需要一段时间,然后在安装完成之前会出现“非常”长的延迟。但最终它会完成,你就可以开始了。