解决 未能载入软件包“WebDriverAgentRunner”,因为它已损坏或丢失必要的资源。

APPIUM 版本1.7.0

WDA build真机时会提示 “未能载入软件包“WebDriverAgentRunner”,因为它已损坏或丢失必要的资源。 

2017-04-19 16:45:53.366908 XCTRunner[10203:3854208] (dlopen_preflight(/var/containers/Bundle/Application/827F554F-55B7-4B5B-9F4C-75A14EB3A143/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/WebDriverAgentRunner): Library not loaded: @rpath/RoutingHTTPServer.framework/RoutingHTTPServer
  Referenced from: /private/var/containers/Bundle/Application/827F554F-55B7-4B5B-9F4C-75A14EB3A143/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/WebDriverAgentLib.framework/WebDriverAgentLib
  Reason: no suitable image found.  Did find:
/private/var/containers/Bundle/Application/827F554F-55B7-4B5B-9F4C-75A14EB3A143/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/WebDriverAgentLib.framework/Frameworks/RoutingHTTPServer.framework/RoutingHTTPServer: code signature invalid for '/private/var/containers/Bundle/Application/827F554F-55B7-4B5B-9F4C-75A14EB3A143/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/WebDriverAgentLib.framework/Frameworks/RoutingHTTPServer.framework/RoutingHTTPServer'
 
但是使用模拟器又没有问题。
 
关键点:Library not loaded: @rpath/RoutingHTTPServer.framework/RoutingHTTPServer
可以猜测是由于依赖的该framework出现问题导致错误
 
 
解决思路:
 
一.查看wda依赖framework是否正常。
 在wda目录下执行:
./Scripts/bootstrap.sh -d
Fetching dependencies

二:Xcode中设置buildphases 加入RoutingHTTPServer

 
原文地址:https://www.cnblogs.com/dapped/p/8891128.html