当我从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)
解决方法:在设备上截取屏幕截图
我认为它已全部连接,这是已知的问题,因此有一天它将被修复。