问题
I am attempting to use Appium to test my app on the ios simulator on my mac OS X 10.9.3. I can start the server fine but when I attempt to run my test I receive the following error:
info: [debug] Error: xcode-select threw an error
at /Applications/Appium.app/Contents/Resources/node_modules/appium/lib/helpers.js:499:10
at ChildProcess.exithandler (child_process.js:652:7)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:756:16)
at Process.ChildProcess._handle.onexit (child_process.js:823:5)
info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: xcode-select threw an error)","origValue":"xcode-select threw an error"},"sessionId":null}
info: <-- POST /wd/hub/session 500 31.780 ms - 176
error: xcode-select threw error Error: Command failed: /bin/sh: xcode-select: command not found
I have checked the bin/sh folder and my xcode-select file does not live there, instead it is located at /usr/bin.
Do I need to configure appium to look in the usr/bin folder for the xcode-select file? If so how do I do this?
Or is there something else I need to do?
Other Information: I am using zsh and in my .zshrc file I have the following listed:
export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
(not sure if that information is useful or not)
Also I am using rspec/capybara for my tests. I have added the appium_capybara gem and it installed all other required gems. I have added the following driver information:
desired_caps_ios = {
platform: "Mac",
deviceName: "iPhone Simulator",
platformName: "iOS",
platformVersion: "7.1",
app: "/Applications/Appium.app/Contents/MacOS/my appname/Payload/appname.app"
}
url = "http://localhost:4723/wd/hub" # or a sauce labs url
Capybara.register_driver(:appium) do |app|
appium_lib_options = {
server_url: url
}
all_options = {
appium_lib: appium_lib_options,
caps: desired_caps_ios
}
Appium::Capybara::Driver.new app, all_options
end
Capybara.default_driver = :appium
回答1:
Based on this commment (Isaac is one of the contributors), xcode-select should be in /usr/bin
and it clearly is.
I would go to where Appium is installed and run appium-doctor --ios
to test if it thinks everything is setup correctly. (This makes sure xcode's command line utils are installed correctly)
If it does not, I suggest reinstalling Appium with appium-version-manager
(link) and trying a few different versions of Appium. If it was a bug with Appium, I feel like more people would have run into it.
回答2:
OK, so finally got back to this issue. Seems like my problem was the way I installed Appium. I installed using the appium package. Deleted the package and installed via node and it seems to have fixed the path issue.
来源:https://stackoverflow.com/questions/25952908/appium-xcode-select-threw-an-error-command-not-found