当我从XCUIScreen.main.screenshot()运行XCTestCase(在Xcode 10 GM中)时,测试崩溃:

dyld: lazy symbol binding failed: can't resolve symbol _XCStringFromRect in /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/lib/../../Library/Frameworks/XCTest.framework/XCTest because dependent dylib #12 could not be loaded
dyld: can't resolve symbol _XCStringFromRect in /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/lib/../../Library/Frameworks/XCTest.framework/XCTest because dependent dylib #12 could not be loaded

最佳答案

Release notes说(Known Issues in Xcode 10 – IDE):
运行iOS 12的设备可能无法从Xcode的“设备”窗口拍摄请求的屏幕快照。(42873539)
解决方法:在设备上截图
我认为这一切都有关联,这是众所周知的问题,所以总有一天它会被修复的。

关于swift - Xcode 10 GM:XCUIScreen.main.screenshot()崩溃,原因是dyld:懒惰的符号绑定(bind)失败。,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/52310244/

10-10 20:50
查看更多