question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to run iOS tests with locally installed Appium server

See original GitHub issue

The problem

I’m unable to run iOS tests against locally installed Appium server whereas globally installed Appium server works fine. Appium server version is the same in both cases and app is prebuild.

Error: Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 65

Environment

  • Appium version (or git revision) that exhibits the issue: 1.6.4-beta
  • Last Appium version that did not exhibit the issue (if applicable): 1.6.3
  • Desktop OS/version used to run Appium: Mac OS 10.12.4
  • Node.js version (unless using Appium.app|exe): v7.2.0
  • Mobile platform/version under test: iOS 10.3, Xcode 8.3
  • Real device or emulator/simulator: Simulator
  • Appium CLI or Appium.app|exe: CLI

Details

Test run against locally installed Appium server fails with an error

[XCUITest] Error: Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 65
    at XCUITestDriver.quitAndUninstall$ (../../lib/driver.js:369:15)
    at tryCatch (/Users/janijegoroff/projects/mobile-ios-app/mobile-common/bdd/node_modules/babel-runtime/regenerator/runtime.js:67:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (/Users/janijegoroff/projects/mobile-ios-app/mobile-common/bdd/node_modules/babel-runtime/regenerator/runtime.js:315:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Users/janijegoroff/projects/mobile-ios-app/mobile-common/bdd/node_modules/babel-runtime/regenerator/runtime.js:100:21)
    at GeneratorFunctionPrototype.invoke (/Users/janijegoroff/projects/mobile-ios-app/mobile-common/bdd/node_modules/babel-runtime/regenerator/runtime.js:136:37)
    at process._tickCallback (internal/process/next_tick.js:103:7)
 Error: Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 65
    at XCUITestDriver.quitAndUninstall$ (../../lib/driver.js:369:15)
    at tryCatch (/Users/janijegoroff/projects/mobile-ios-app/mobile-common/bdd/node_modules/babel-runtime/regenerator/runtime.js:67:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (/Users/janijegoroff/projects/mobile-ios-app/mobile-common/bdd/node_modules/babel-runtime/regenerator/runtime.js:315:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Users/janijegoroff/projects/mobile-ios-app/mobile-common/bdd/node_modules/babel-runtime/regenerator/runtime.js:100:21)
    at GeneratorFunctionPrototype.invoke (/Users/janijegoroff/projects/mobile-ios-app/mobile-common/bdd/node_modules/babel-runtime/regenerator/runtime.js:136:37)
    at process._tickCallback (internal/process/next_tick.js:103:7)
[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:369:15)
    at tryCatch (/Users/janijegoroff/projects/mobile-ios-app/mobile-common/bdd/node_modules/babel-runtime/regenerator/runtime.js:67:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (/Users/janijegoroff/projects/mobile-ios-app/mobile-common/bdd/node_modules/babel-runtime/regenerator/runtime.js:315:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Users/janijegoroff/projects/mobile-ios-app/mobile-common/bdd/node_modules/babel-runtime/regenerator/runtime.js:100:21)
    at GeneratorFunctionPrototype.invoke (/Users/janijegoroff/projects/mobile-ios-app/mobile-common/bdd/node_modules/babel-runtime/regenerator/runtime.js:136:37)
    at process._tickCallback (internal/process/next_tick.js:103:7)

Link to Appium logs

See logs for both success and failed cases https://gist.github.com/JaniJegoroff/9bffa4d87fcdb19d1b7ebb1b5acfa8de

Code To Reproduce Issue [ Good To Have ]

Common for both global and local test runs

  • App is prebuild
  • Appium server version is the same

Test run against globally installed Appium server

  1. Install Appium server globally: npm install -g appium@beta
  2. Launch globally installed Appium server: appium
  3. Launch the tests

Result: test is passed

Test run against locally installed Appium server

  1. Define package.json
{
  "name": "xxx-test-runner",
  "version": "1.0.0",
  "private": true,
  "devDependencies": {
    "appium": "1.6.4-beta"
  }
}
  1. Install Appium server locally: npm install
  2. Launch test where Appium server is started with command: node node_modules/appium -a localhost -p 4723 --log-level error

Result: test fails with an error

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mykola-mokhnachcommented, Mar 28, 2017

It fails because of WDA warning in Xcode 8.3/iOS 10.3. Try to apply this patch to local WDA source.

0reactions
lock[bot]commented, Apr 29, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting - Appium
If you see iOS Simulator failed to install the application. and the paths are correct, try restarting the computer.
Read more >
Using AppiumDriverLocalService to run tests on IOS failed
Hi all, I'm working with Appium for the past few months and everything worked really good. My next goal is to run Appium...
Read more >
Appium IOS tests running when server started manually but ...
Attempting to run Appium automation scripts on iOS (simulator) on a Mac Mini (M1 chip, if that's relevant). When I run the tests, ......
Read more >
I'm getting "The local appium server has not been started. The ...
I try to run AppiumParallelTests with iOS physical device and I'm getting ... System.out.println(“No devices are free to run test or Failed to...
Read more >
Start appium server programmatically with iPhone is failing
When I start the appium server via terminal tests run successfully. So now I tried to run the appium programmatically with the below...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found