Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Appium Error: Could not get Xcode version

Appium error when trying to launch test on eclipse. I have installed Xcode 6.4 and it should work but it doesn't.

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);
    }
}
like image 627
Anton Anton Avatar asked Sep 22 '15 18:09

Anton Anton


2 Answers

I was using command line Appium. To resolve the issue you have to switch Xcode to the proper path.

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.

like image 71
Thejus Krishna Avatar answered Oct 17 '22 02:10

Thejus Krishna


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)

like image 30
Georg Ritzmann Avatar answered Oct 17 '22 03:10

Georg Ritzmann