xcode iOS运行两个模拟器失败:无法在当前状态下查找:停机

vyu0f0g1  于 2023-03-04  发布在  iOS
关注(0)|答案(3)|浏览(144)

我正在尝试在更多的模拟器上运行我的(React原生)应用程序。

yarn run ios --simulator="iPhone SE"
# also tried
yarn run ios --simulator="iPhone SE (2nd generation)"

第一个模拟器成功启动,但另一个失败。
我有错误:
无法在当前状态下查找:停机
Xcode版本:13.0,模拟器
操作系统版本:macOS大苏尔11.5.2

success Successfully built the app
--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Any iOS Simulator Device }
{ platform:iOS Simulator, id:FDCE0C7E-5917-42BB-AD4E-FAAA3D726BEE, OS:13.5, name:iPhone 8 }
{ platform:iOS Simulator, id:1034D1B6-A0EF-4334-A4F8-C74E74B092E6, OS:15.0, name:iPhone 8 }
{ platform:iOS Simulator, id:93D44AD6-FB9A-4E8F-819E-52FFC9DD01F5, OS:13.5, name:iPhone 8 Plus }
{ platform:iOS Simulator, id:3FB69956-5357-44CE-88EF-DF02A6930C1D, OS:15.0, name:iPhone 8 Plus }
{ platform:iOS Simulator, id:3AEA5922-A5DE-4F26-9C41-056DD18DE33F, OS:13.5, name:iPhone 11 }
{ platform:iOS Simulator, id:C18F8CC6-6712-45EC-B10B-838CF1961B20, OS:15.0, name:iPhone 11 }
{ platform:iOS Simulator, id:6815E116-44A3-47C3-A454-82EF37C20BE5, OS:13.5, name:iPhone 11 Pro }
{ platform:iOS Simulator, id:C095653C-0FD3-493C-B4E6-D65CEEDCE135, OS:15.0, name:iPhone 11 Pro }
{ platform:iOS Simulator, id:BC6B4577-2A4B-43C8-B1F9-54B0755D3D19, OS:13.5, name:iPhone 11 Pro Max }
{ platform:iOS Simulator, id:5180B3F4-3D40-487C-941B-F0A3A0B28570, OS:15.0, name:iPhone 11 Pro Max }
{ platform:iOS Simulator, id:6D22A3E2-F0B7-40A6-9E30-05CB3837470D, OS:15.0, name:iPhone 12 }
{ platform:iOS Simulator, id:20AF9F18-024F-4242-9113-94BB855B1BA6, OS:15.0, name:iPhone 12 Pro }
{ platform:iOS Simulator, id:639D955E-9BA8-4ECF-BA68-DC6C1F9CCD74, OS:15.0, name:iPhone 12 Pro Max }
{ platform:iOS Simulator, id:612F66A0-7050-45D0-A46F-805E390AF074, OS:15.0, name:iPhone 12 mini }
{ platform:iOS Simulator, id:0FE7C078-556D-40F9-8198-375C10B3991D, OS:15.0, name:iPhone 13 }
{ platform:iOS Simulator, id:885D1181-08F8-438A-8B9A-FE940BCCA59B, OS:15.0, name:iPhone 13 Pro }
{ platform:iOS Simulator, id:5803C768-0E6F-420C-A236-0637CE433775, OS:15.0, name:iPhone 13 Pro Max }
{ platform:iOS Simulator, id:8A9F4BC4-D751-4D25-8290-E3D35C46F48F, OS:15.0, name:iPhone 13 mini }
{ platform:iOS Simulator, id:493495F3-2F78-4A60-B937-FDDA6A533282, OS:13.5, name:iPhone SE }
{ platform:iOS Simulator, id:9731F210-9C16-43AB-AC99-22C2E55F1F86, OS:13.5, name:iPhone SE (2nd generation) }
{ platform:iOS Simulator, id:6B410509-2517-4909-8174-F42CBEE974B8, OS:15.0, name:iPhone SE (2nd generation) }
{ platform:iOS Simulator, id:D0C1C85A-C505-4902-ADCA-BA9408964D2C, OS:13.5, name:iPhone X }
{ platform:iOS Simulator, id:CAF4BBDC-BEB9-4C23-B947-F1A0CE626012, OS:15.0, name:iPod touch (7th generation) }
{ platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device }
{ platform:iOS Simulator, id:9BF4625F-142F-427D-A9D1-8A831C62E63B, OS:13.5, name:iPad (7th generation) }
{ platform:iOS Simulator, id:3745BC92-4688-4B75-9D92-25EF2FCC52DB, OS:15.0, name:iPad (9th generation) }
{ platform:iOS Simulator, id:6AB2E356-D8D1-42A4-B2B7-BA18DCA7F543, OS:13.5, name:iPad Air (3rd generation) }
{ platform:iOS Simulator, id:350A8457-97C3-440D-B521-BD9BD067F3CB, OS:15.0, name:iPad Air (4th generation) }
{ platform:iOS Simulator, id:3FA72A11-0536-4BDC-B113-503D31731401, OS:13.5, name:iPad Pro (9.7-inch) }
{ platform:iOS Simulator, id:67CD5DF7-5037-4B80-8711-8BD3692A18E9, OS:15.0, name:iPad Pro (9.7-inch) }
{ platform:iOS Simulator, id:68CD4C92-AD3D-4F55-B258-E8FF6B557E8A, OS:13.5, name:iPad Pro (11-inch) (2nd generation) }
{ platform:iOS Simulator, id:9ABE2EC3-245C-4189-AD56-13D8FC0D808E, OS:15.0, name:iPad Pro (11-inch) (3rd generation) }
{ platform:iOS Simulator, id:CF04F4B8-6B81-4DC3-9FF0-0C5FE3465587, OS:13.5, name:iPad Pro (12.9-inch) (4th generation) }
{ platform:iOS Simulator, id:F1B64316-868F-409B-8932-03A8570279B9, OS:15.0, name:iPad Pro (12.9-inch) (5th generation) }
{ platform:iOS Simulator, id:D9D361CC-479C-4856-A560-699C5D1A91A1, OS:15.0, name:iPad mini (6th generation) }
info Installing "/Users/babu/Library/Developer/Xcode/DerivedData/MyApp-axbsjlkepgdnjucdpwvjpiaqcuef/Build/Products/Debug-iphonesimulator/MyApp.app"
An error was encountered processing the command (domain=com.apple.CoreSimulator.SimError, code=405):
Unable to lookup in current state: Shutdown
info Launching "org.myapp.ios.dev"
error Failed to launch the app on simulator, An error was encountered processing the command (domain=com.apple.CoreSimulator.SimError, code=405):
Unable to lookup in current state: Shutdown
f45qwnt8

f45qwnt81#

我在把Xcode升级到13.0版本后遇到了这个问题,这是由于Xcode缓存造成的。你可以清除DerivedData文件夹来解决这个问题
您可以尝试执行以下步骤来解决此问题:
1.打开Xode并选择Preferences > Locations

1.打开首选项面板后,单击/Xcode/DerivedData旁边的箭头,这将打开一个查找器窗口。

1.删除DerivedData文件夹中的所有子目录
1.关闭Xcode并清理构建应用程序以安装在iOS设备上

yarn ios

这应该会自动启动iPhone模拟器并修复你的问题。如果没有,你也可以尝试删除Xcode进程:Build error domain=com.apple.CoreSimulator.SimError, code=405

pnwntuvh

pnwntuvh2#

**tl;dr:**通过模拟器工具手动启动第二个sim卡,然后运行run-ios命令并匹配--simulator标志,以定位您刚刚打开的sim卡。

我尝试了Ravi的建议,以及他链接的线程中的建议,以及他链接的线程中链接的苹果开发线程中的建议,不知道为什么,但我自己仍然在体验。
在我的例子中,当一个sim已经运行时,尝试第二个run-ios命令会产生OP错误。
1.通过以下方式手动启动第二个SIM卡:xcode -> open developer tool -> simulator -> file -> open simulator -> simName.
1.Yarn运行-ios命令,带标志--simulator="simName".
(To请确保你指向正确的sim卡与正确的ios版本,你可以给予你的sim卡一个描述性的名称通过:xcode -> window -> devices & simulators -> simulators -> click a name on the left panel to rename)

9avjhtql

9avjhtql3#

对我来说,我输入的是“iPhone SE(第三代)”--而实际上是"iPhone SE (3rd generation)"
Apple没有将“Generation”大写!正确的字符串为generation-全部小写。
左;右react-native run-ios --simulator='iPhone SE (3rd generation)'

相关问题