ramdev
ramdev

Reputation: 301

Getting error when running appium in a iOS device

I am trying to run Appium on my ios device. I was able to install webdriveragent on my device and the build is ok but when I try to test the connectivity from my java app I am getting below error.

Could not start a new session. Response code 500. Message: 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. 
This usually indicates an issue with the local Xcode setup or WebDriverAgent project configuration or the driver-to-platform version mismatch. 
Consider setting 'showXcodeLog' capability to true in order to check the Appium server log for build-related error messages.. 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.

Here is my Java code to test the connectivity

    DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setCapability("platformName", "iOS");
    capabilities.setCapability("platformVersion", "16.6.1");
    capabilities.setCapability("deviceName", "");    

    capabilities.setCapability("udid", "00008030-000000000");
    capabilities.setCapability("xcodeSigningId", "iPhone Developer");
    capabilities.setCapability("automationName", "xcuitest");
    
    
     driver = new IOSDriver(new URL("http://0.0.0.0:4723"), capabilities);

Upvotes: 0

Views: 754

Answers (2)

Dinesh Kumar
Dinesh Kumar

Reputation: 81

Try with,

  1. Uninstalling WD agent -> Reboot the device -> Build the fresh WD agent via xcode
  2. Try with create session using Appium inspector
  3. Sometimes after WD agent appeared, when you tap it might ask you to trust the WD agent, try with trusting the same via Setting -> General -> About -> Certificate trust settings
  4. Look for the following command in the appium session console, 'xcodebuild build-for-testing test-without-building -project /Users/Dinesh/node_modules/appium-xcuitest-driver/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination id=xxxx IPHONEOS_DEPLOYMENT_TARGET=16.5 GCC_TREAT_WARNINGS_AS_ERRORS=0 COMPILER_INDEX_STORE_ENABLE=NO' in directory '/Users/Dinesh/node_modules/appium-xcuitest-driver/node_modules/appium-webdriveragent' -> Copy the command -> execute the command -> perform the step-3 -> perform the step-2

Upvotes: 0

monil
monil

Reputation: 77

We get this error when WebDriverAgent is not compatible with your XCode version. I have already answer this to get latest WDA and update it in Appium folder
https://stackoverflow.com/a/76107073/6021277
In the answer I have taken XCode 14.2 but you can check WDA compatible to your XCode

Upvotes: 0

Related Questions