我通过 Carthage 使用 ios-snapshot-test-case v5.0.2 遇到了这个错误。该问题与 XCode 11 有关。Apple 重命名libswiftXCTest.dylib
为libXCTestSwiftSupport.dylib
并添加了XCTest.swiftmodule
其中具有相同符号的符号,并且可以代替旧符号工作。但 Apple 忘记告诉 iOS 11.x 模拟器这一变化。
所以你需要修复旧的iOS版本模拟器。这是为我修复它的终端命令:
sudo zsh -c ' sourcedir="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/lib";
targetdir="/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 11.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib";
ln -s $sourcedir/libXCTestSwiftSupport.dylib $targetdir/libswiftXCTest.dylib;
ln -s $sourcedir/XCTest.swiftmodule $targetdir/XCTest.swiftmodule'
在这里查看我的评论:https ://github.com/CocoaPods/CocoaPods/issues/9165#issuecomment-573523322