-
-
Save liamnichols/3507faf70ecca201cb4300645caa9b74 to your computer and use it in GitHub Desktop.
sudo mkdir /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ 11.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift | |
sudo ln -s /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ 11.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/Swift/libswiftXCTest.dylib /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ 11.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift |
This is awesome! I was stuck on this issue for weeks and creating the symbolic link fixed it for me. Thank you!
OMG! Thanks!
@muehlemann: Glad it helped! I haven't tried it, but I also spotted this comment which might be the real "fix":
@liamnichols Great thanks for the info, will be watching that cocoapods issue.
@muehlemann: Glad it helped! I haven't tried it, but I also spotted this comment which might be the real "fix":
This cocoapods "fix" doesn't really help because it means you have to modify the framework's .xcodeproj and then rebuild the framework. If that framework is a third-party dependency that you're including via CocoaPods or Carthage, then actually the kind of solution you're suggesting is a much better idea.
But one thing sticks out from Apple's suggested fix mentioned on that thread: they are saying that libswiftXCTest.dylib
is obsolete and has been replaced by libXCTestSwiftSupport.dylib
, which "should" have all the same symbols in it. So, if you want to use this newer .dylib, then you would want to set up your symlinks like this:
sudo mkdir /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ 11.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift
sudo ln -s /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ 11.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/Swift/libswiftXCTest.dylib /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS\ 11.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift
Personally I think this is due to a bug in XCode... it should be able to find that .dylib. But Apple has created a literal hell of duplicated directory trees throughout their development apps like XCode and Simulator. It's gotten so out of control that it's no wonder this kind of problem is happening.
When running unit tests on an iOS 11 simulator in Xcode 11.1, I was getting the following:
Not sure why exactly, but for some reason libswiftXCTest.dylib isn't correctly located in the iOS 11.4 Simulator Runtime and as a result the test bundle wouldn't load. I guess it could be a mixture of Swift ABI related things and a bug in Xcode 11 but by linking the framework into the correct location the bundle can run now so its good enough for me