2014-09-20 99 views
1

我正在嘗試在我的Mac OS X 10.9.3上使用Appium在ios模擬器上測試我的應用程序。我可以啓動服務器正常,但當我嘗試運行我的測試,我收到以下錯誤:Appium-xcode-select拋出一個錯誤:command not found

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以查找usr/bin文件夾中的xcode選擇文件嗎?如果是這樣,我該怎麼做?

或者還有什麼我需要做的嗎?

其他信息: 我使用的zsh,在我的.zshrc文件,我有以下幾種:

export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin 

(不知道這些信息是否有用)

而且我使用rspec/capybara爲我的測試。我已經添加了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 
+0

Appium版本?從源代碼運行?如果你做'sudo xcode-select --switch/Applications/Xcode.app/Contents/Developer',然後嘗試,會發生什麼? – sheeptest 2014-09-22 16:11:50

+0

Appium版本1.2.2。嘗試運行上述命令,然後重新運行測試,我得到同樣的問題。我還編輯了我的原始問題,並提供了更多細節。 – user1523236 2014-09-22 19:17:21

回答

0
基於 this commment

(艾薩克是貢獻者之一)時,Xcode選應該/usr/bin,它顯然是。

我會去Appium的安裝位置並運行appium-doctor --ios來測試它是否認爲所有設置都是正確的。 (這可以確保xcode的命令行utils安裝正確)

如果沒有,我建議重新安裝Appium appium-version-managerlink)並嘗試幾個不同版本的Appium。如果這是Appium的一個bug,我覺得更多的人會遇到它。

0

好吧,終於回到了這個問題。似乎我的問題是我安裝Appium的方式。我使用appium軟件包進行安裝。刪除軟件包並通過節點安裝,它似乎已修復路徑問題。

相關問題