[iOS] [XCUITest] Error: Could not determine iOS SDK version: Command 'xcrun' not found. Is it installed?

Below is the error:

[XCUITest] Error: Could not determine iOS SDK version: Command ‘xcrun’ not found. Is it installed?
at Object.wrappedLogger.errorAndThrow (…/…/lib/logging.js:63:13)
at getAndCheckIosSdkVersion$ (…/…/lib/utils.js:74:9)
at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at process._tickCallback (internal/process/next_tick.js:103:7)
Error: Could not determine iOS SDK version: Command ‘xcrun’ not found. Is it installed?
at Object.wrappedLogger.errorAndThrow (…/…/lib/logging.js:63:13)
at getAndCheckIosSdkVersion$ (…/…/lib/utils.js:74:9)
at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at process._tickCallback (internal/process/next_tick.js:103:7)
[XCUITest] Error: Could not determine iOS SDK version: Command ‘xcrun’ not found. Is it installed?
at Object.wrappedLogger.errorAndThrow (…/…/lib/logging.js:63:13)
at getAndCheckIosSdkVersion$ (…/…/lib/utils.js:74:9)
at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at process._tickCallback (internal/process/next_tick.js:103:7)
Error: Could not determine iOS SDK version: Command ‘xcrun’ not found. Is it installed?
at Object.wrappedLogger.errorAndThrow (…/…/lib/logging.js:63:13)
at getAndCheckIosSdkVersion$ (…/…/lib/utils.js:74:9)
at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at process._tickCallback (internal/process/next_tick.js:103:7)
[debug] [XCUITest] Not clearing log files. Use clearSystemFiles capability to turn on.
[MJSONWP] Encountered internal error running command: Error: Could not determine iOS SDK version: Command ‘xcrun’ not found. Is it installed?
at Object.wrappedLogger.errorAndThrow (…/…/lib/logging.js:63:13)
at getAndCheckIosSdkVersion$ (…/…/lib/utils.js:74:9)
at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at process._tickCallback (internal/process/next_tick.js:103:7)

I am facing this issue when I try to run my testng.xml file in eclipse. If I run the code manually without using testng.xml it works fine. Can somebody please help me?

I have tried this but no luck. I am not sure where it is failing. I set up environment variables, but still, it is failing.

Is it getting the same error? What did you try exactly?

I figured it out this issue. But I am facing another issue: Carthage not found. Install using brew install Carthage" still occurred, What should I do next? Even though Carthage is installed.

You have to put Carthage on the path too. Use the Eclipse environment variable article to add it to the $PATH.

How you fix this issue

what was the resolution? I am also getting the same issue in eclipse

Carthage not found issue resolution

  1. Right click on your project > Run as > Run Configurations
  2. Select Environment tab
  3. Click on select option and select PATH environment
  4. Edit Path variable using Edit option
  5. Update path value with carthage location /usr/local/bin and select append env to native env
  6. Apply changes and run the test.