報錯信息以下:git
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_XCElementSnapshot", referenced from:
l_OBJC_$_CATEGORY_XCElementSnapshot_$_FBIsVisible in XCUIElement+FBIsVisible.o
l_OBJC_$_CATEGORY_XCElementSnapshot_$_FBUID in XCUIElement+FBUID.o
l_OBJC_$_CATEGORY_XCElementSnapshot_$_WebDriverAttributes in XCUIElement+FBWebDriverAttributes.o
objc-class-ref in XCUIElement+FBWebDriverAttributes.o
objc-class-ref in XCUIElement+FBUtilities.o
l_OBJC_$_CATEGORY_XCElementSnapshot_$_FBAccessibility in XCUIElement+FBAccessibility.o
l_OBJC_$_CATEGORY_XCElementSnapshot_$_FBScrolling in XCUIElement+FBScrolling.o
...
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)github
緣由分析:蘋果將XCElementSnapshot從XCTest.framework移動到了私有的XCTAutomationSupport.frameworkweb
形成文件沒法importxcode
結果辦法:code
在文件WebDriverAgent.xcodeproj/project.pbxproj中增長部分代碼,增長途中綠色部分,具體增長的代碼查看webDriverAgent做者在git中的提交blog
https://github.com/facebook/WebDriverAgent/commit/c4da863b9c8d6d076ba74bf1ff58b47ef56dd2fa#diff-7610c17549f7cb63943c12afdfd7ba64R613get