我试图用Appium,以测试在我的Mac OS X 10.9.3的iPhone模拟器我的应用程序。 我可以启动服务器正常,但当我尝试运行我的测试,我收到以下错误:
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
我已经检查了bin / sh的文件夹,我的Xcode选文件不住在那里,而是位于位于/ usr / bin中。
我是否需要配置appium在Xcode的选文件USR / bin文件夹看看? 如果是的话我该怎么做呢?
还是有别的东西,我需要做什么?
其他信息:我使用的zsh,在我的.zshrc文件,我有以下几种:
export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
(不知道这些信息是否有用)
另外我使用的RSpec /水豚为我的测试。 我已经加入了appium_capybara宝石,它安装了所有其他需要的宝石。 我已经添加了以下驱动程序信息:
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