Appium 错误:无法获取 Xcode 版本
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/32724616/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Appium Error: Could not get Xcode version
提问by Anton Anton
Appium error when trying to launch test on eclipse. I have installed Xcode 6.4 and it should work but it doesn't.
尝试在 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.
Eclipse code
日食代码
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import org.openqa.selenium.remote.DesiredCapabilities;
import io.appium.java_client.ios.IOSDriver;
import io.appium.java_client.remote.MobileCapabilityType;
public class Uicatalog {
public static void main(String[] args) throws MalformedURLException {
DesiredCapabilities cap=new DesiredCapabilities();
File f=new File("/Users/afiliptsov/Application to study/ui-catalog-app.zip");
cap.setCapability(MobileCapabilityType.PLATFORM_VERSION, "8.4");
cap.setCapability(MobileCapabilityType.DEVICE_NAME, "iPhone 5s");
cap.setCapability(MobileCapabilityType.BROWSER_NAME, "");
cap.setCapability(MobileCapabilityType.APP, f.getAbsolutePath());
IOSDriver driver = new IOSDriver(new URL("http://127.0.0.1:4723/wd/hub"),cap);
}
}
回答by Thejus Krishna
I was using command line Appium. To resolve the issue you have to switch Xcode to the proper path.
我正在使用命令行 Appium。要解决此问题,您必须将 Xcode 切换到正确的路径。
The following command will help:
以下命令将有所帮助:
sudo xcode-select --switch /Applications/Xcode.app
If you have installed Xcode app in a different location, give that path instead of /Applications/Xcode.app.
如果您在其他位置安装了 Xcode 应用程序,请提供该路径而不是 /Applications/Xcode.app。
回答by FrancisKmart
First i reset it using sudo xcode-select --reset
首先我使用sudo xcode-select --reset重置它
and then used sudo xcode-select --switch /Applications/Xcode.app
然后使用 sudo xcode-select --switch /Applications/Xcode.app
Note: just make sure you set correct path to Xcode (Application->Xcode)
注意:只需确保设置正确的 Xcode 路径(应用程序-> Xcode)
回答by Georg Ritzmann
Had the same issue, the problem was that the path to XCode was in Appium was set to something like "xcode/library/developer/commandlinetools". Setting the correct path to Xcode(in my case: "MacintoshHD/Applications/Xcode 2") in the advanced iOS Settings solved the problem for me.(Xcode 7, Appium 1.4.13)
有同样的问题,问题是 XCode 在 Appium 中的路径设置为“xcode/library/developer/commandlinetools”之类的东西。在高级 iOS 设置中设置正确的 Xcode 路径(在我的情况下:“MacintoshHD/Applications/Xcode 2”)为我解决了这个问题。(Xcode 7,Appium 1.4.13)
回答by Hyman Wilson
Maybe you are using Xcode version 10 and It is not support appium because appium server problem, you can back to Xcode ver 9.
or use appium beta
:
也许您使用的是 Xcode 版本 10 并且它不支持 appium 因为 appium 服务器问题,您可以返回Xcode ver 9.
或使用appium beta
:
npm uninstall -g appium && npm install -g appium@beta
回答by Kedar Sukerkar
Xcode 11
Xcode 11
Check whether Command Line Tools of respective Xcode Version are installed or enabled
检查是否安装或启用了相应 Xcode 版本的命令行工具
回答by June
Run sudo xcode-select -r before open appium desktop
在打开 appium 桌面之前运行 sudo xcode-select -r
回答by Devdutta Goyal
Best way to resolve this is to move the Xcode application into your Applications folder on mac machine.
解决此问题的最佳方法是将 Xcode 应用程序移动到 Mac 机器上的 Applications 文件夹中。