应用程序错误:无法获取Xcode版本

应用程序错误:无法获取Xcode版本,xcode,testing,mobile,automation,appium,Xcode,Testing,Mobile,Automation,Appium,尝试在eclipse上启动测试时出现Appium错误。 我已经安装了Xcode 6.4,它应该可以工作,但它不能 error: Could not determine Xcode version:Could not get Xcode version. /Library/Developer/Info.plist does not exist on disk. info: [debug] Setting iOS SDK Version info: [debug] Cleaning up appi

尝试在eclipse上启动测试时出现Appium错误。 我已经安装了Xcode 6.4,它应该可以工作,但它不能

error: Could not determine Xcode version:Could not get Xcode version. /Library/Developer/Info.plist does not exist on disk.

info: [debug] Setting iOS SDK Version
info: [debug] Cleaning up appium session
info: [debug] Error: Could not get Xcode version. /Library/Developer/Info.plist does not exist on disk.
    at getVersionWithoutRetry$ (lib/xcode.js:115:11)
    at tryCatch (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-xcode/node_modules/babel-runtime/regenerator/runtime.js:67:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-xcode/node_modules/babel-runtime/regenerator/runtime.js:294:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-xcode/node_modules/babel-runtime/regenerator/runtime.js:100:21)
    at GeneratorFunctionPrototype.invoke (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-xcode/node_modules/babel-runtime/regenerator/runtime.js:136:37)
    at bound (domain.js:254:14)
    at GeneratorFunctionPrototype.runBound (domain.js:267:12)
    at run (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-xcode/node_modules/babel-runtime/node_modules/core-js/library/modules/es6.promise.js:89:39)
    at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-xcode/node_modules/babel-runtime/node_modules/core-js/library/modules/es6.promise.js:100:28
    at process._tickDomainCallback (node.js:381:11)
info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Could not get Xcode version. /Library/Developer/Info.plist does not exist on disk.)","origValue":"Could not get Xcode version. /Library/Developer/Info.plist does not exist on disk."},"sessionId":null}
info: <-- POST /wd/hub/session 500 470.776 ms - 286 

error: Could not determine iOS SDK version
error: Failed to start an Appium session, err was: Error: Could not get Xcode version. /Library/Developer/Info.plist does not exist on disk.

有同样的问题,问题是到XCode的路径在Appium中被设置为类似“XCode/library/developer/commandlinetools”。
在高级iOS设置中设置Xcode的正确路径(在我的例子中是:“MacintoshHD/Applications/Xcode 2”)为我解决了这个问题。(Xcode 7,Appium 1.4.13)

我使用的是命令行Appium。要解决此问题,必须将Xcode切换到正确的路径

以下命令将有助于:

sudo xcode-select --switch /Applications/Xcode.app
如果您在其他位置安装了Xcode应用程序,请提供该路径,而不是/Applications/Xcode.app。

首先,我使用 sudo xcode选择——重置

然后用 sudo xcode选择——开关/应用程序/xcode.app


注意:只需确保您将正确的路径设置为Xcode(应用程序->Xcode)

解决此问题的最佳方法是将Xcode应用程序移动到mac计算机上的应用程序文件夹中。

可能您使用的是Xcode版本10,它不支持appium,因为appium服务器出现问题,您可以返回到
Xcode 9版。
或使用
appium beta

npm uninstall -g appium && npm install -g appium@beta

Xcode 11


检查是否安装或启用了相应Xcode版本的命令行工具

在打开appium desktop之前运行sudo Xcode select-r

设置在appium GUI中,您从哪里获得appium 1.4.13?当前版本是1.2.6。@strizhechenko 1.2.6是Appium Desktop的版本,它有自己的版本编号。对于1.4.3,我指的是使用过的Appium单机版,现在是1.7.1,请参阅:如果上面的命令不起作用。尝试重新启动Appium并再次运行。谢谢@朗元
npm uninstall -g appium && npm install -g appium@beta