[Appium 2.X - WebDriverAgent] - Unable to install and launch webdriver agent on the real ios device

The problem -

Unable to install and launch webdriveragent on real ios device.

Environment -

  1. Appium Version:- 2.0.1
  2. Appium Driver:- [email protected]
  3. MacOS - Ventura 13.4.1©
  4. X-Code version:- 14.3.1
  5. Node.js version:- v18.16.0
  6. Npm Version:- 9.5.1
  7. Mobile platform/version under test:- iPhone 7 Plus (iOS 15.7.7)

Problem Details -

I have to test a hybrid iOS app. Appium server is able to install webdriverAgent on Simulator (iPhone 14). The integration app is getting installed but the webdriveragent app is not getting installed to the real device.

Solutions I tried:-

  1. https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md - Completed both full manual and automatic configuration but it didn’t work.
  2. I went through multiple videos on youtube, saying that change the “Product Bundle Identifier” to something else. But that also didn’t work.
  3. I also tried manual installation of WebDriverAgentRunner on Real Device, but no luck.

Error:
Failed to create session. An unknown server-side error occurred while processing the command. Original error: Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 65 xcodebuild error message: . Make sure you follow the tutorial at https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md. Try to remove the WebDriverAgentRunner application from the device if it is installed and reboot the device.

Kindly help me. Thanks

enable appium server debug logs. it should be more info there what exactly fails

1 Like

I am facing the similar issue

attaching on intellij idea I am getting :

org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.

on appium server log I am getting no such driver error intermittently.

1 Like
[debug] [XCUITestDriver@069a]     "platformName": "IOS",
[debug] [XCUITestDriver@069a]     "appium:automationName": "XCUITest",
[debug] [XCUITestDriver@069a]     "appium:bundleId": "io.full.answerconnect",
[debug] [XCUITestDriver@069a]     "appium:clearSystemFiles": true,
[debug] [XCUITestDriver@069a]     "appium:deviceName": "iPhone 7 Plus",
[debug] [XCUITestDriver@069a]     "appium:platformVersion": "15.7",
[debug] [XCUITestDriver@069a]     "appium:udid": "a665******71****ca19*******c529bd7d*****"
[debug] [XCUITestDriver@069a]   },
[debug] [XCUITestDriver@069a]   "firstMatch": [
[debug] [XCUITestDriver@069a]     {}
[debug] [XCUITestDriver@069a]   ]
[debug] [XCUITestDriver@069a] }
[XCUITestDriver@069a (7bd8cfad)] Session created with session id: 7bd8cfad-a9eb-41cd-9073-a8eb9e0a0f27
[debug] [XCUITest] Current user: 'swapnil'
[debug] [XCUITestDriver@069a (7bd8cfad)] Available devices: a665******71****ca19*******c529bd7d*****
[debug] [XCUITest] Creating iDevice object with udid 'a665******71****ca19*******c529bd7d*****'
[XCUITestDriver@069a (7bd8cfad)] Determining device to run tests on: udid: 'a665******71****ca19*******c529bd7d*****', real device: true
[debug] [XCUITestDriver@069a (7bd8cfad)] Event 'xcodeDetailsRetrieved' logged at 1690359506352 (13:48:26 GMT+0530 (India Standard Time))
[debug] [XCUITestDriver@069a (7bd8cfad)] Event 'appConfigured' logged at 1690359506354 (13:48:26 GMT+0530 (India Standard Time))
[debug] [XCUITestDriver@069a (7bd8cfad)] Event 'resetStarted' logged at 1690359506354 (13:48:26 GMT+0530 (India Standard Time))
[debug] [XCUITest] Reset: running ios real device reset flow
[debug] [XCUITestDriver@069a (7bd8cfad)] Event 'resetComplete' logged at 1690359506355 (13:48:26 GMT+0530 (India Standard Time))
[XCUITestDriver@069a (7bd8cfad)] Using WDA path: '/Users/swapnil/node_modules/appium-webdriveragent'
[XCUITestDriver@069a (7bd8cfad)] Using WDA agent: '/Users/swapnil/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj'
[debug] [XCUITestDriver@069a (7bd8cfad)] Event 'logCaptureStarted' logged at 1690359507008 (13:48:27 GMT+0530 (India Standard Time))
[XCUITestDriver@069a (7bd8cfad)] Setting up real device
[debug] [XCUITestDriver@069a (7bd8cfad)] No obsolete cached processes from previous WDA sessions listening on port 8100 have been found
[DevCon Factory] Requesting connection for device a665******71****ca19*******c529bd7d***** on local port 8100, device port 8100
[debug] [DevCon Factory] Cached connections count: 0
[DevCon Factory] Successfully requested the connection for a665******71****ca19*******c529bd7d*****:8100
[debug] [XCUITestDriver@069a (7bd8cfad)] Parsed BUILD_DIR configuration value: '/Users/swapnil/Library/Developer/Xcode/DerivedData/WebDriverAgent-epxcjkbdbesuzxbaffxveezfbujk/Build/Products'
[debug] [XCUITestDriver@069a (7bd8cfad)] Got derived data root: '/Users/swapnil/Library/Developer/Xcode/DerivedData/WebDriverAgent-epxcjkbdbesuzxbaffxveezfbujk'
[debug] [XCUITestDriver@069a (7bd8cfad)] Starting WebDriverAgent initialization with the synchronization key '/Users/swapnil/Library/Developer/Xcode/DerivedData/WebDriverAgent-epxcjkbdbesuzxbaffxveezfbujk'
[debug] [WD Proxy] Matched '/status' to command name 'getStatus'
[debug] [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] [iProxy@a66595d7:8100] Connection was refused to port 8100
[WD Proxy] socket hang up
[debug] [XCUITestDriver@069a (7bd8cfad)] WDA is not listening at 'http://127.0.0.1:8100/'
[debug] [XCUITestDriver@069a (7bd8cfad)] WDA is currently not running. There is nothing to cache
[debug] [XCUITestDriver@069a (7bd8cfad)] Trying to start WebDriverAgent 1 times with 10000ms interval
[debug] [XCUITestDriver@069a (7bd8cfad)] These values can be customized by changing wdaStartupRetries/wdaStartupRetryInterval capabilities
[debug] [XCUITestDriver@069a (7bd8cfad)] Event 'wdaStartAttempted' logged at 1690359520022 (13:48:40 GMT+0530 (India Standard Time))
[XCUITestDriver@069a (7bd8cfad)] Launching WebDriverAgent on the device
[XCUITestDriver@069a (7bd8cfad)] There is no need to perform the project cleanup. A fresh install has been detected
[debug] [WebDriverAgent] Killing running processes 'xcodebuild.*a665******71****ca19*******c529bd7d*****' for the device a665******71****ca19*******c529bd7d*****...
[debug] [WebDriverAgent] 'pgrep -if xcodebuild.*a665******71****ca19*******c529bd7d*****' didn't detect any matching processes. Return code: 1
[debug] [XCUITestDriver@069a (7bd8cfad)] Beginning test with command 'xcodebuild build-for-testing test-without-building -project /Users/swapnil/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -derivedDataPath /Users/swapnil/Library/Developer/Xcode/DerivedData/WebDriverAgent-epxcjkbdbesuzxbaffxveezfbujk -destination id=a665******71****ca19*******c529bd7d***** IPHONEOS_DEPLOYMENT_TARGET=15.7 GCC_TREAT_WARNINGS_AS_ERRORS=0 COMPILER_INDEX_STORE_ENABLE=NO' in directory '/Users/swapnil/node_modules/appium-webdriveragent'
[debug] [XCUITestDriver@069a (7bd8cfad)] Output from xcodebuild will only be logged if any errors are present there. To change this, use 'showXcodeLog' desired capability
[debug] [XCUITestDriver@069a (7bd8cfad)] Waiting up to 60000ms for WebDriverAgent to start
[debug] [XCUITestDriver@069a (7bd8cfad)] Matched '/status' to command name 'getStatus'
[debug] [XCUITestDriver@069a (7bd8cfad)] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] [iProxy@a66595d7:8100] Connection was refused to port 8100
[XCUITestDriver@069a (7bd8cfad)] socket hang up
[debug] [XCUITestDriver@069a (7bd8cfad)] Matched '/status' to command name 'getStatus'
[debug] [XCUITestDriver@069a (7bd8cfad)] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] [iProxy@a66595d7:8100] Connection was refused to port 8100
[XCUITestDriver@069a (7bd8cfad)] socket hang up
[debug] [XCUITestDriver@069a (7bd8cfad)] Matched '/status' to command name 'getStatus'
[debug] [XCUITestDriver@069a (7bd8cfad)] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] [iProxy@a66595d7:8100] Connection was refused to port 8100
[XCUITestDriver@069a (7bd8cfad)] socket hang up
[debug] [XCUITestDriver@069a (7bd8cfad)] Matched '/status' to command name 'getStatus'
[debug] [XCUITestDriver@069a (7bd8cfad)] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] [iProxy@a66595d7:8100] Connection was refused to port 8100
[XCUITestDriver@069a (7bd8cfad)] socket hang up
[debug] [XCUITestDriver@069a (7bd8cfad)] Matched '/status' to command name 'getStatus'
[debug] [XCUITestDriver@069a (7bd8cfad)] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] [iProxy@a66595d7:8100] Connection was refused to port 8100
[XCUITestDriver@069a (7bd8cfad)] socket hang up
[debug] [XCUITestDriver@069a (7bd8cfad)] Matched '/status' to command name 'getStatus'
[debug] [XCUITestDriver@069a (7bd8cfad)] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] [iProxy@a66595d7:8100] Connection was refused to port 8100
[XCUITestDriver@069a (7bd8cfad)] socket hang up
[debug] [XCUITestDriver@069a (7bd8cfad)] Matched '/status' to command name 'getStatus'
[debug] [XCUITestDriver@069a (7bd8cfad)] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] [iProxy@a66595d7:8100] Connection was refused to port 8100
[XCUITestDriver@069a (7bd8cfad)] socket hang up
[debug] [XCUITestDriver@069a (7bd8cfad)] Matched '/status' to command name 'getStatus'
[debug] [XCUITestDriver@069a (7bd8cfad)] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] [iProxy@a66595d7:8100] Connection was refused to port 8100
[XCUITestDriver@069a (7bd8cfad)] socket hang up
[Xcode] xcodebuild exited with code '65' and signal 'null'
[XCUITestDriver@069a (7bd8cfad)] Launching WebDriverAgent on the device
[XCUITestDriver@069a (7bd8cfad)] There is no need to perform the project cleanup. A fresh install has been detected
[debug] [WebDriverAgent] Killing running processes 'xcodebuild.*a665******71****ca19*******c529bd7d*****' for the device a665******71****ca19*******c529bd7d*****...
[debug] [WebDriverAgent] 'pgrep -if xcodebuild.*a665******71****ca19*******c529bd7d*****' didn't detect any matching processes. Return code: 1
[debug] [XCUITestDriver@069a (7bd8cfad)] Beginning test with command 'xcodebuild build-for-testing test-without-building -project /Users/swapnil/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -derivedDataPath /Users/swapnil/Library/Developer/Xcode/DerivedData/WebDriverAgent-epxcjkbdbesuzxbaffxveezfbujk -destination id=a665******71****ca19*******c529bd7d***** IPHONEOS_DEPLOYMENT_TARGET=15.7 GCC_TREAT_WARNINGS_AS_ERRORS=0 COMPILER_INDEX_STORE_ENABLE=NO' in directory '/Users/swapnil/node_modules/appium-webdriveragent'
[debug] [XCUITestDriver@069a (7bd8cfad)] Output from xcodebuild will only be logged if any errors are present there. To change this, use 'showXcodeLog' desired capability
[debug] [XCUITestDriver@069a (7bd8cfad)] Matched '/status' to command name 'getStatus'
[debug] [XCUITestDriver@069a (7bd8cfad)] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] [iProxy@a66595d7:8100] Connection was refused to port 8100
[XCUITestDriver@069a (7bd8cfad)] socket hang up
[debug] [XCUITestDriver@069a (7bd8cfad)] Matched '/status' to command name 'getStatus'
[debug] [XCUITestDriver@069a (7bd8cfad)] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] [iProxy@a66595d7:8100] Connection was refused to port 8100
[XCUITestDriver@069a (7bd8cfad)] socket hang up
[debug] [XCUITestDriver@069a (7bd8cfad)] Waiting up to 60000ms for WebDriverAgent to start
[debug] [XCUITestDriver@069a (7bd8cfad)] Matched '/status' to command name 'getStatus'
[debug] [XCUITestDriver@069a (7bd8cfad)] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] [iProxy@a66595d7:8100] Connection was refused to port 8100
[XCUITestDriver@069a (7bd8cfad)] socket hang up
[debug] [XCUITestDriver@069a (7bd8cfad)] Matched '/status' to command name 'getStatus'
[debug] [XCUITestDriver@069a (7bd8cfad)] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] [iProxy@a66595d7:8100] Connection was refused to port 8100
[XCUITestDriver@069a (7bd8cfad)] socket hang up
[debug] [XCUITestDriver@069a (7bd8cfad)] Matched '/status' to command name 'getStatus'
[debug] [XCUITestDriver@069a (7bd8cfad)] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] [iProxy@a66595d7:8100] Connection was refused to port 8100
[XCUITestDriver@069a (7bd8cfad)] socket hang up
[debug] [XCUITestDriver@069a (7bd8cfad)] Matched '/status' to command name 'getStatus'
[debug] [XCUITestDriver@069a (7bd8cfad)] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] [iProxy@a66595d7:8100] Connection was refused to port 8100
[XCUITestDriver@069a (7bd8cfad)] socket hang up
[debug] [XCUITestDriver@069a (7bd8cfad)] Matched '/status' to command name 'getStatus'
[debug] [XCUITestDriver@069a (7bd8cfad)] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] [iProxy@a66595d7:8100] Connection was refused to port 8100
[XCUITestDriver@069a (7bd8cfad)] socket hang up
[debug] [XCUITestDriver@069a (7bd8cfad)] Matched '/status' to command name 'getStatus'
[debug] [XCUITestDriver@069a (7bd8cfad)] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] [iProxy@a66595d7:8100] Connection was refused to port 8100
[XCUITestDriver@069a (7bd8cfad)] socket hang up
[debug] [XCUITestDriver@069a (7bd8cfad)] Matched '/status' to command name 'getStatus'
[debug] [XCUITestDriver@069a (7bd8cfad)] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] [iProxy@a66595d7:8100] Connection was refused to port 8100
[XCUITestDriver@069a (7bd8cfad)] socket hang up
[debug] [XCUITestDriver@069a (7bd8cfad)] Matched '/status' to command name 'getStatus'
[debug] [XCUITestDriver@069a (7bd8cfad)] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] [iProxy@a66595d7:8100] Connection was refused to port 8100
[XCUITestDriver@069a (7bd8cfad)] socket hang up
[debug] [XCUITestDriver@069a (7bd8cfad)] Matched '/status' to command name 'getStatus'
[debug] [XCUITestDriver@069a (7bd8cfad)] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] [iProxy@a66595d7:8100] Connection was refused to port 8100
[XCUITestDriver@069a (7bd8cfad)] socket hang up
[debug] [XCUITestDriver@069a (7bd8cfad)] Matched '/status' to command name 'getStatus'
[debug] [XCUITestDriver@069a (7bd8cfad)] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] [iProxy@a66595d7:8100] Connection was refused to port 8100
[XCUITestDriver@069a (7bd8cfad)] socket hang up
[debug] [XCUITestDriver@069a (7bd8cfad)] Matched '/status' to command name 'getStatus'
[debug] [XCUITestDriver@069a (7bd8cfad)] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[debug] [iProxy@a66595d7:8100] Connection was refused to port 8100
[XCUITestDriver@069a (7bd8cfad)] socket hang up
[debug] [XCUITestDriver@069a (7bd8cfad)] Matched '/status' to command name 'getStatus'
[debug] [XCUITestDriver@069a (7bd8cfad)] Proxying [GET /status] to [GET http://127.0.0.1:8100/status] with no body
[Xcode] xcodebuild exited with code '65' and signal 'null'
[debug] [XCUITestDriver@069a (7bd8cfad)] Event 'wdaStartFailed' logged at 1690359538813 (13:48:58 GMT+0530 (India Standard Time))
[debug] [XCUITestDriver@069a (7bd8cfad)] Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 65
[debug] [XCUITestDriver@069a (7bd8cfad)] xcodebuild error message:
[debug] [XCUITestDriver@069a (7bd8cfad)] . Make sure you follow the tutorial at https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md. Try to remove the WebDriverAgentRunner application from the device if it is installed and reboot the device.
[XCUITestDriver@069a (7bd8cfad)] Quitting and uninstalling WebDriverAgent
[XCUITestDriver@069a (7bd8cfad)] Shutting down sub-processes
[debug] [iProxy@a66595d7:8100] Connection was refused to port 8100
[XCUITestDriver@069a (7bd8cfad)] socket hang up
[debug] [XCUITestDriver@069a (7bd8cfad)] No WDAs on the device.
[XCUITestDriver@069a (7bd8cfad)] {}
[DevCon Factory] Releasing connections for a665******71****ca19*******c529bd7d***** device on any port number
[DevCon Factory] Found cached connections to release: ["a665******71****ca19*******c529bd7d*****:8100"]
[DevCon Factory] Releasing the listener for 'a665******71****ca19*******c529bd7d*****:8100'
[debug] [iProxy@a66595d7:8100] Closing the connection
[debug] [DevCon Factory] Cached connections count: 0
[iProxy@a66595d7:8100] The connection has been closed
[debug] [XCUITest] Did not find the temporary XCTest logs root at '/var/folders/vt/hj91jbks1rqf5976z9cq_0940000gp/T/com.apple.dt.XCTest*/'
[XCUITest] Cleaning test logs in '/Users/swapnil/Library/Developer/Xcode/DerivedData/WebDriverAgent-epxcjkbdbesuzxbaffxveezfbujk/Logs' folder
[debug] [XCUITest] Clearing log files
[debug] [XCUITest] Deleting '/Users/swapnil/Library/Developer/Xcode/DerivedData/WebDriverAgent-epxcjkbdbesuzxbaffxveezfbujk/Logs'. Freeing 356K.
[debug] [XCUITest] Finished clearing log files
[debug] [AppiumDriver@2476] Event 'newSessionStarted' logged at 1690359539207 (13:48:59 GMT+0530 (India Standard Time))
[debug] [AppiumDriver@2476] Encountered internal error running command: Error: Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 65
[debug] [AppiumDriver@2476] xcodebuild error message:
[debug] [AppiumDriver@2476] . Make sure you follow the tutorial at https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md. Try to remove the WebDriverAgentRunner application from the device if it is installed and reboot the device.
[debug] [AppiumDriver@2476]     at quitAndUninstall (/Users/swapnil/node_modules/appium-xcuitest-driver/lib/driver.js:808:15)
[debug] [AppiumDriver@2476]     at /Users/swapnil/node_modules/appium-xcuitest-driver/lib/driver.js:894:13
[debug] [AppiumDriver@2476]     at wrapped (/Users/swapnil/node_modules/asyncbox/lib/asyncbox.js:95:13)
[debug] [AppiumDriver@2476]     at retry (/Users/swapnil/node_modules/asyncbox/lib/asyncbox.js:68:13)
[debug] [AppiumDriver@2476]     at retryInterval (/Users/swapnil/node_modules/asyncbox/lib/asyncbox.js:105:10)
[debug] [AppiumDriver@2476]     at /Users/swapnil/node_modules/appium-xcuitest-driver/lib/driver.js:833:7
[HTTP] <-- POST /session 500 33225 ms - 1216```

i am having exactly same issue in

  1. Appium Version:- 2.0.1
  2. Appium Driver:- [email protected]
  3. MacOS - Ventura 13.4.1©
  4. X-Code version:- 14.4
  5. Node.js version:- v18.16.0
  6. Npm Version:- 9.5.1
  7. Mobile platform/version under test:- iPhone XS (iOS 15.7.7)
    please help.
1 Like

use google guava dependency