go-ios icon indicating copy to clipboard operation
go-ios copied to clipboard

Error 'Could not determine Xcode version:' when starting an Appium session

Open giacomofuria opened this issue 7 months ago • 2 comments
trafficstars

I am trying to run automated tests on an iPad using Appium, and I would like to use go-ios to execute these tests without needing a Mac. I installed WebDriverAgent on the iPad using a MacBook, and now, after connecting the iPad to my Windows PC, I am trying to get go-ios to work.

So far, I have successfully:

  1. Started a tunnel using the command: "ios tunnel start"

  2. Started WebDriverAgent using the command: "ios runwda"

At this point, after starting Appium on my PC, I am trying to launch a test, but in the Appium logs, I get the following error:

"Failed to create session. An unknown server-side error occurred while processing the command. Original error: Could not determine Xcode version: Cannot determine the path to Xcode by running 'xcode-select -p' command. Original error: 'xcode-select' executable is not found neither in the process working folder"

Am I doing something wrong? Or what can I do to successfully run a test with Appium? Thanks a lot to everyone for the support!

giacomofuria avatar Mar 27 '25 16:03 giacomofuria

I get the same thing, it seems to me that xctest should be run only through go-ios and not appium

somethingintheway1 avatar Mar 31 '25 15:03 somethingintheway1

I found a workaround for this issue by adding the following capability to Appium session: "appium:webDriverAgentUrl": "http://<ipad_ip_address>:8100". This way, Appium skips the xcode-select call, and I was able to start the session directly on the iPad connected to my Windows PC.

if (_.isEmpty(this.xcodeVersion) && (this.isXcodebuildNeeded() || this.isSimulator())) {
      // no `webDriverAgentUrl`, or on a simulator, so we need an Xcode version
      this.xcodeVersion = await getAndCheckXcodeVersion();
}

This is the portion of code of appium-xcuitest-driver (lib/driver.js) where you can see that the getAndCheckXcodeVersion() function is called only if the webDriverAgentUrl capability is not provided, or if the test is being run on a simulator

giacomofuria avatar Apr 09 '25 10:04 giacomofuria