appium: Unable to launch WebDriverAgent because of xcodebuild failure

Do I have the most recent component updates?

  • I use the most recent available driver/plugin and server versions

Is the component officially supported by the Appium team?

  • I have verified the component repository is present under the Appium organization in GitHub

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Mac OS: Sonoma 14.1.1 Appium Version: 2.2.2 XCode: 15.0.1

Build gets installed but then error occurring. Error while running the tests:

xcodebuild exited with code ‘70’ and signal ‘null’. WARN webdriver: Request failed with status 500 due to An unknown server-side error occurred while processing the command. Original error: Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 70

ERROR webdriver: Request failed with status 500 due to unknown error: An unknown server-side error occurred while processing the command. Original error: Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 70 [0-0] xcodebuild error message:

Expected Behavior

There should not be any error and it was working fine but after upgrading to Xcode we started seeing this webdriver error.

Minimal Reproducible Example

Error occurs outside of the test code

Environment

  • Operating system:
  • Appium server version (output of appium --version):
  • Appium driver(s) and their version(s):
  • Appium plugin(s) and their version(s):
  • Node.js version (output of node --version):
  • npm version (output of npm --version):
  • Last component(s) version which did not exhibit the problem:
  • Platform and version under test:
  • Real device or emulator/simulator:

Link to Appium Logs

No response

Further Information

No response

About this issue

  • Original URL
  • State: closed
  • Created 7 months ago
  • Comments: 17 (1 by maintainers)

Most upvoted comments

[XCUITestDriver@9a06] "appium:autoAcceptAlerts": true,
[XCUITestDriver@9a06] "appium:automationName": "XCUITest",
[XCUITestDriver@9a06] "appium:platformVersion": "17.0",
[XCUITestDriver@9a06] "appium:showXcodeLog": true,
[XCUITestDriver@9a06] "appium:orientation": "PORTRAIT",
[XCUITestDriver@9a06] "appium:noReset": false,
[XCUITestDriver@9a06] "appium:fullReset": true,
[XCUITestDriver@9a06] "appium:app": "/Users/user/repo/app/ios/App.app",
[XCUITestDriver@9a06] "appium:udid": "F8987D05-1CD7-4FEC-9984-96BF9972792F"

it looks like xcodebuild command by Apple found two simulator devices, that had iOS 16.2 while your capabilities specified iOS 17, thus the xcodebuild probably confused. You should specify the udid properly, or you may also drop specifying the udid so that Appium can create a new simulator instance with the iOS version

[Xcode] ** TEST BUILD SUCCEEDED **
[Xcode]
[Xcode]
[Xcode] --- xcodebuild: WARNING: Using the first of multiple matching destinations:
[Xcode] { platform:iOS Simulator, id:F8987D05-1CD7-4FEC-9984-96BF9972792F, OS:16.2, name:iPhone 14 }
[Xcode] { platform:iOS Simulator, id:F8987D05-1CD7-4FEC-9984-96BF9972792F, OS:16.2, name:iPhone 14 }
[Xcode]
[Xcode] 2023-11-28 08:32:55.428 xcodebuild[15514:1378671] Writing error result bundle to /var/folders/xy/65d72zv556n7kcb_nt8mccb80000gn/T/ResultBundle_2023-28-11_08-32-0055.xcresult
[Xcode]
[XCUITestDriver@9a06 (36b58193)] Matched '/status' to command name 'getStatus'
[XCUITestDriver@9a06 (36b58193)] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[XCUITestDriver@9a06 (36b58193)] connect ECONNREFUSED 127.0.0.1:8100
[Xcode] xcodebuild: error: Failed to build project WebDriverAgent with scheme WebDriverAgentRunner.: Cannot test target “WebDriverAgentRunner” on “iPhone 14”: iPhone 14’s iOS Simulator 16.2 doesn’t match WebDriverAgentRunner’s iOS Simulator 17.0 deployment target.
[Xcode]
[Xcode] xcodebuild exited with code '70' and signal 'null'
[XCUITestDriver@9a06 (36b58193)] Launching WebDriverAgent on the device
[XCUITestDriver@9a06 (36b58193)] WebDriverAgent does not need a cleanup. The sources are up to date (1686805366721 >= 1686805366721)
[WebDriverAgent] Killing running processes 'xcodebuild.*F8987D05-1CD7-4FEC-9984-96BF9972792F, F8987D05-1CD7-4FEC-9984-96BF9972792F.*XCTRunner, xctest.*F8987D05-1CD7-4FEC-9984-96BF9972792F' for the device F8987D05-1CD7-4FEC-9984-96BF9972792F...
[WebDriverAgent] 'pgrep -if xcodebuild.*F8987D05-1CD7-4FEC-9984-96BF9972792F' didn't detect any matching processes. Return code: 1

Please provide server log with xcodebuild logging enabled