1、出错环境:
Xcode版本:10.2.1
语言:swift
设备:模拟器9.3及以前的系统版本
2.出错文本:
dyld: Library not loaded: /usr/lib/libauto.dylib
Referenced from: /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
Reason: no suitable image found. Did find:
/usr/lib/libauto.dylib: mach-o, but not built for iOS simulator
3.出错原因:
iOS 9.3及更早版本的模拟器可能无法启动带有“dyld: Library not loaded: /usr/lib/libauto.dylib”消息的Swift应用程序。Xcode10.2没有9.3以前的libauto.dylib这个系统库,模拟器运行时需要添加这个库。
4.解决方法:
在终端运行以下命令,对应iOS版本:
sudo mkdir '/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 模拟器版本.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift'
例子:
sudo mkdir '/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 9.3.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift'
5.官方文档链接:
https://developer.apple.com/documentation/xcode_release_notes/xcode_10_2_1_release_notes