Xcode 10.2无法在iOS <10的模拟器上运行应用程序

JyT*_*Tee 61 xcode dyld ios xcode10.2

自更新以来,我一直在使用Xcode 10.2,当我尝试在iOS版本低于10的任何模拟器上运行我的应用程序时,模拟器将无法启动并崩溃,然后显示以下错误:

dyld:未加载库:/usr/lib/libauto.dylib引用自:/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation原因:找不到合适的映像。确实找到了:/usr/lib/libauto.dylib:mach-o,但不是为iOS模拟器构建的

我尝试不碰任何东西重新创建另一个新项目,将部署目标设置为iOS 9,然后再次在iOS 9模拟器上运行,但显示了相同的错误。

更新

似乎仅当您的代码库包含swift时才会出现此问题。用目标C代码库创建一个新项目不会使模拟器崩溃。为了迅速。

摘要

  1. Xcode 10.2包含无法在iOS 9模拟器上运行应用程序的快速代码
  2. 我已完成所有清理工作并删除了派生数据,但问题仍然存在。

有人有什么主意吗?

最后更新

苹果公司刚刚发布了Xcode 10.2.1,它是模拟器已知问题的一部分,有关变通办法/修复,请参考以下链接:

https://developer.apple.com/documentation/xcode_release_notes/xcode_10_2_1_release_notes

感谢@russbishop的回复,已接受回答

rus*_*hop 93

这是一个影响iOS 8.x和9.x的已知错误。您可以通过/usr/lib/swift在相关的模拟器运行时根目录中创建目录来解决此问题。

下载的模拟器运行时位于中/Library/Developer/CoreSimulator/Profiles/Runtimes

例如,要修复iOS 9.3模拟器,请执行以下操作:

sudo mkdir '/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 9.3.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift'
Run Code Online (Sandbox Code Playgroud)

  • 在运行mkdir之前,请确保“ iOS 9.3.simruntime”尚不存在。对我来说,“ ... / RuntimeRoot / usr / lib / swift”缺少“ swift”文件夹。只需导航至“ / Library / Developer / CoreSimulator / Profiles / Runtimes / iOS 9.3.simruntime / Contents / Resources / RuntimeRoot / usr / lib”并创建“ swift”修复程序的目录即可。 (6认同)

iOS*_*iOS 10

在iOS 9.0模拟器中运行时,我也遇到了同样的问题。

From https://developer.apple.com/documentation/xcode_release_notes/xcode_10_2_1_release_notes

Simulators for iOS 9.3 and earlier might fail to launch Swift apps with the message: “dyld: Library not loaded: /usr/lib/libauto.dylib”. (49326587) Workaround: Run the following command in Terminal for the relevant version of iOS:

sudo mkdir '/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 9.3.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift'
Run Code Online (Sandbox Code Playgroud)

For this apple given above solution in that link.

Simply

--> open Terminal

--> Type this line with your required version (In my case i changed into iOS 9.3 to iOS 9.0)

Ex: sudo mkdir '/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 9.0.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift'

--> Enter password

--> Now clean Xcode and run again

This above solution worked for me.


Hug*_*o F 5

Xcode 10.3 仍然会出现此错误。(跳过 10.2。)


Mih*_*ian 5

这似乎是一个iOS模拟器错误。我看到这种情况发生在装有iOS 12.0的模拟器上,但没有出现在装有12.4的模拟器上。