java-client icon indicating copy to clipboard operation
java-client copied to clipboard

Getting exception Command 'xcrun' is not found. Is it installed? while executing using eclipse

Open Sourabh25 opened this issue 7 years ago • 16 comments

The problem

When I am trying to start the appium server programmatically and then instantiate the IOSDriver, I am getting the Exception Command 'xcrun' is not found. Is it installed?

Environment

  • Appium version (or git revision) that exhibits the issue:1.13.0
  • Desktop OS/version used to run Appium: macOS Mojave
  • Node.js version (unless using Appium.app|exe):v12.6.0
  • Npm or Yarn package manager: Npm
  • Mobile platform/version under test: ios 12.4
  • Real device or emulator/simulator: Simulator

Details

Please find the testng trace: java.lang.RuntimeException: Failed to initialize Test --- Failed to start Device --- Error in starting the DeviceFailed to getDriver --- An unknown server-side error occurred while processing the command. Original error: Command 'xcrun' not found. Is it installed? Build info: version: '3.6.0', revision: '6fbf3ec767', time: '2017-09-27T15:28:36.4Z' System info: host: 'HQSML-152086', ip: '2601:88:8201:5f80:b91e:11d:3bdd:5188', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.14.6', java.version: '1.8.0_151' Driver info: driver.version: GetMobileDriver remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: Command 'xcrun' not found. Is it installed? at getResponseForW3CError (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:826:9) at asyncHandler (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/protocol.js:447:37) at com.comcast.utils.ComcastTestMain.startTestMain(ComcastTestMain.java:1138) at com.comcast.utils.ComcastTestMain.beforeTest_startTestMain(ComcastTestMain.java:955) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85) at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:510) at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:211) at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138) at org.testng.TestRunner.beforeRun(TestRunner.java:648) at org.testng.TestRunner.run(TestRunner.java:616) at org.testng.SuiteRunner.runTest(SuiteRunner.java:359) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:354) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:312) at org.testng.SuiteRunner.run(SuiteRunner.java:261) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1191) at org.testng.TestNG.runSuitesLocally(TestNG.java:1116) at org.testng.TestNG.run(TestNG.java:1024) at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:115) at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251) at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)

I am not getting this issue when I am starting the appium server manually and instantiating the IOSDriver

Sourabh25 avatar Sep 04 '19 15:09 Sourabh25

https://github.com/appium/appium/search?q=%22Command+%27xcrun%27+is+not+found%22&type=Issues

Closed as duplicate

mykola-mokhnach avatar Sep 04 '19 17:09 mykola-mokhnach

I referred to these links but could not resolve my issue. Could you please help me in resolving this. Thanks

Sourabh25 avatar Sep 04 '19 18:09 Sourabh25

@mykola-mokhnach I referred to these links but could not resolve my issue. Could you please help me in resolving this. Thanks

Sourabh25 avatar Sep 04 '19 18:09 Sourabh25

Unfortunately we cannot help there. This is a problem with your operating system. xcrun is part of the standard Xcode installation. If it is not there it most likely means the deployment is broken due to an unknown reason

mykola-mokhnach avatar Sep 04 '19 18:09 mykola-mokhnach

Are the command line tools for Xcode installed?

imurchie avatar Sep 04 '19 19:09 imurchie

@mykola-mokhnach xcrun is working fine on terminal. I can see this issue only when I am running the script through eclipse. If i keep the appium server started, the test runs fine. When I am starting the appium server using AppiumServiceBuilder, only then I am running into this. If you cant help, could you please tell me who can help me here?

Sourabh25 avatar Sep 04 '19 19:09 Sourabh25

@imurchie yes command line tools are installed.

Sourabh25 avatar Sep 04 '19 19:09 Sourabh25

Then it's probably not in your PATH in Eclipse.

imurchie avatar Sep 04 '19 19:09 imurchie

@imurchie How can i set it in my eclipse PATH? I just need to add it to my PATH environment variable in eclipse. correct?

Sourabh25 avatar Sep 04 '19 19:09 Sourabh25

I have added the path /Applications/Xcode.app in the PATH variable in the eclipse

Screen Shot 2019-09-04 at 3 44 36 PM

Sourabh25 avatar Sep 04 '19 19:09 Sourabh25

@imurchie @mykola-mokhnach Can someone kindly help me on this... I am still not able to figure out the issue... It is somehow working fine with the intelliJ but giving the error with eclipse. If you can tell me what is the environment variable i need to update, that would be greta help. Thanks.

Sourabh25 avatar Sep 09 '19 18:09 Sourabh25

I don't use Eclipse so I cannot say how to do it, specifically. I can just point you to the java client's docs on environment variables. https://github.com/appium/java-client/blob/master/docs/environment.md

The developers on that repo might have more information on things.

imurchie avatar Sep 09 '19 19:09 imurchie

@imurchie Thanks... Could you please move this ticket to appim-java-client repo and change the status to Open

Sourabh25 avatar Sep 09 '19 19:09 Sourabh25

@imurchie Thanks a lot

Sourabh25 avatar Sep 09 '19 20:09 Sourabh25

@SrinivasanTarget So no one can give me resolution on this forum? I am still getting this issue when using eclipse but it is working fine with IntelliJ

Sourabh25 avatar Sep 19 '19 20:09 Sourabh25

@Sourabh25 : Hi Sourabh , were you able to find solution to this issue?

reddyVara avatar Oct 29 '19 20:10 reddyVara