【问题标题】:Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 65由于 xcodebuild 失败,无法启动 WebDriverAgent:xcodebuild failed with code 65
【发布时间】:2017-10-24 21:22:38
【问题描述】:

我正在尝试使用以下设置运行 appium 脚本:

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)

【问题讨论】:

    标签: java iphone selenium-webdriver automation appium-ios


    【解决方案1】:

    它正在设备中打开 WebDriverAgent 应用程序。通过以下链接并为您的手机配置 WebDriverAgent 应用程序。

    Unable to launch ipa file in IOS 10 real Device using appium 1.6.0

    【讨论】:

      【解决方案2】:

      按照以下步骤,我已经使用 Appium 在 iOS 真实设备上启动了 safari 浏览器。

      1. 我们需要使用终端在 Mac 上安装 WebDriverAgent。

        xcodebuild build test -project /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination id= -configuration Debug

      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 浏览器。

      【讨论】:

        【解决方案3】:

        这个问题我花了四天时间解决^_^。

        第一种方法,不要从终端更新appium。尝试卸载并安装

        1. npm 卸载 -g appium

        2. npm install -g appium

        第二种方法, 从终端运行 appium 而不是 UI appium。

        第三种方法,

        如果您在 Appium 桌面应用程序中仍然收到此错误, 请检查,您是否安装了多个 xcode 版本?当我尝试上述两种方法时,我的个人经验是它不起作用,因为 appium 使用最新的 xcode 路径(在 appium 发行说明中,最新的 xcode 12.3 尚不支持)。所以我改变了旧的xcode路径使用

        sudo xcode-select -s /Applications/Xcode12.2.app/Contents/Developer

        幸运的是它工作正常。

        【讨论】:

          猜你喜欢
          • 2020-10-24
          • 2020-10-01
          • 2019-03-06
          • 2018-07-25
          • 2019-07-13
          • 2020-09-24
          • 2021-10-06
          • 2018-12-23
          • 2021-02-18
          相关资源
          最近更新 更多