2017-05-24 85 views
3

我想下面安裝運行appium腳本:無法啓動WebDriverAgent因爲xcodebuild聯編失敗:xcodebuild聯編失敗,代碼65

Appium version : 1.6.4 
Xcode : 8.3.2 
Mac : 10.12.4 
iPhone : 10.3.1 

下面是我使用推出iPhone真實設備上的Safari瀏覽器的代碼。

desCapabilities = new DesiredCapabilities(); 
desCapabilities.setCapability("platformName","iOS"); 
desCapabilities.setCapability("deviceName", "Ananda's iPhone"); 
desCapabilities.setCapability("platformVersion", "10.3.1"); 
desCapabilities.setCapability("app", "com.apple.mobilesafari"); 
desCapabilities.setCapability("udid", "******"); 
iOSDriver = new IOSDriver<MobileElement>(new URL("http://" + nodeUrl + ":" + nodeUrlPort + "/wd/hub"), desCapabilities); 

我收到錯誤,請在下面找到日誌:

[MJSONWP] Encountered internal error running command: Error: Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 65 
at XCUITestDriver.quitAndUninstall$ (../../lib/driver.js:374:15) 
at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40) 
at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22) 
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21) 
at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37) 
at process._tickCallback (internal/process/next_tick.js:109:7) 

回答

0

通過下面我已經推出了採用Appium的iOS真實設備上的Safari瀏覽器下面的步驟。

  1. 我們需要使用終端在Mac上安裝WebDriverAgent。

    xcodebuild聯編構建測試-project /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination ID = - 構型調試

  2. 運行在命令下方使用Xcode打開WebDriverAgent。

    開放/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj

  3. 在Xcode中,選擇兩個WebDriverAgent和WebDriverAgentLib 「自動管理簽署」 複選框。

  4. 運行Xcode項目。

  5. 一旦構建成功,WebDriverAgent應用程序將安裝在iPhone設備上。

  6. 最後運行Selenium代碼啓動Safari瀏覽器。

相關問題