Appium's IosDriver does not support xcode version 8.0. Apple has deprecated UIAutomation


#1

Getting this error:

Appium server has started…

Oct 28, 2016 2:22:39 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Attempting bi-dialect session, assuming Postel’s Law holds true on the remote end
[HTTP] --> POST /wd/hub/session {“capabilities”:{“desiredCapabilities”:{“app”:"/Volumes/Automation/XXXXXXXX.ipa",“noReset”:true,“newCommandTimeout”:900,“platformVersion”:“9.3.5”,“bundleId”:“com.YYYYY.XXXXXXXX”,“platformName”:“iOS”,“udid”:“79b89XXXXXXXXXX97f32320ea6dXXXXXXXd3121c”,“deviceName”:“OIT-MIO00040”},“requiredCapabilities”:null},“desiredCapabilities”:{“app”:"/Volumes/Automation/XXXXXXXX.ipa",“noReset”:true,“newCommandTimeout”:900,“platformVersion”:“9.3.5”,“bundleId”:“com.YYYYY.XXXXXXXX”,“platformName”:“iOS”,“udid”:“79b89XXXXXXXXXX97f32320ea6dXXXXXXXd3121c”,“deviceName”:“OIT-MIO00040”},“requiredCapabilities”:null}
[debug] [MJSONWP] Bad parameters: BadParametersError: Parameters were incorrect. We wanted {“required”:[“desiredCapabilities”],“optional”:[“requiredCapabilities”,“sessionId”,“id”]} and you sent [“capabilities”,“desiredCapabilities”,“requiredCapabilities”]
[HTTP] <-- POST /wd/hub/session 400 6 ms - 201
Oct 28, 2016 2:22:40 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Falling back to straight W3C remote end connection
[HTTP] --> POST /wd/hub/session {“capabilities”:{“desiredCapabilities”:{“app”:"/Volumes/Automation/XXXXXXXX.ipa",“noReset”:true,“newCommandTimeout”:900,“platformVersion”:“9.3.5”,“bundleId”:“com.YYYYY.XXXXXXXX”,“platformName”:“iOS”,“udid”:“79b89XXXXXXXXXX97f32320ea6dXXXXXXXd3121c”,“deviceName”:“OIT-MIO00040”},“requiredCapabilities”:null}}
[debug] [MJSONWP] Bad parameters: BadParametersError: Parameters were incorrect. We wanted {“required”:[“desiredCapabilities”],“optional”:[“requiredCapabilities”,“sessionId”,“id”,“sessionId”,“id”]} and you sent [“capabilities”]
[HTTP] <-- POST /wd/hub/session 400 2 ms - 173
Oct 28, 2016 2:22:40 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Falling back to original OSS JSON Wire Protocol.
[HTTP] --> POST /wd/hub/session {“desiredCapabilities”:{“app”:"/Volumes/Automation/XXXXXXXX.ipa",“noReset”:true,“newCommandTimeout”:900,“platformVersion”:“9.3.5”,“bundleId”:“com.YYYYY.XXXXXXXX”,“platformName”:“iOS”,“udid”:“79b89XXXXXXXXXX97f32320ea6dXXXXXXXd3121c”,“deviceName”:“OIT-MIO00040”},“requiredCapabilities”:null}
[MJSONWP] Calling AppiumDriver.createSession() with args: [{“app”:"/Volumes/Automatio…
[Appium] Creating new IosDriver session
[Appium] Capabilities:
[Appium] app: ‘/Volumes/Automation/XXXXXXXX.ipa’
[Appium] noReset: true
[Appium] newCommandTimeout: 900
[Appium] platformVersion: ‘9.3.5’
[Appium] bundleId: ‘com.YYYYY.XXXXXXXX’
[Appium] platformName: ‘iOS’
[Appium] udid: ‘79b89XXXXXXXXXX97f32320ea6dXXXXXXXd3121c’
[Appium] deviceName: ‘OIT-MIO00040’
[BaseDriver] Session created with session id: 8c9d87d5-799c-474d-895e-ecb63a841c62
[Xcode] Finding XcodePath by symlink because Error: Command ‘xcode-select --print-path’ errored out: Error: spawn xcode-select ENOENT
at exports._errnoException (util.js:1026:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:359:16)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
[debug] [iOS] Xcode version set to 8.0
[iOS] SessionNotCreatedError: A new session could not be created. Details: Appium’s IosDriver does not support xcode version 8.0. Apple has deprecated UIAutomation. Use the “XCUITest” automationName capability instead.
at IosDriver.createSession$ (lib/driver.js:120:28)

Setting the desired capabilities like this in Eclipse:

if(platformInfoObject.PlatformName.equalsIgnoreCase(“iOS”)){

                    AppiumDriver<WebElement> driver = null;
                    DesiredCapabilities capabilities = new DesiredCapabilities();
                    capabilities.setCapability("platformName", platformInfoObject.PlatformName);
                    capabilities.setCapability("platformVersion", "9.3.5");
                    capabilities.setCapability("deviceName", "OIT-MIO00040");
                    capabilities.setCapability("udid", platformInfoObject.PlatformID);
                    capabilities.setCapability("newCommandTimeout", 900);
                    capabilities.setCapability("bundleId", "com.YYYYY.XXXXXXXX");
                    //capabilities.setCapability("autoAcceptAlerts", true);
                    capabilities.setCapability("noReset", true);
                    capabilities.setCapability("app", platformInfoObject.AppPath);
                    driver = new IOSDriver<WebElement>(new URL("http://"+platformInfoObject.ServerURL+":"+platformInfoObject.ServerPortNumber+"/wd/hub"), capabilities);
                    driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);
                    return driver;
                }

Please Let me know what wrong i am doing and how to use XCUITest insted of Appium IOS driver


#2

Yeah we have a new framework called xcuitest, here is way to setup appium 1.6: Xcodebuild failed with code 65 (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 32.63 seconds
and make you download the dependencies where the webdriver agent is saved:

“./Scripts/bootstrap.sh -d”


#3

hi pavan i tried ur steps but still getting the same error…like A new session could not be created. Details: Appium’s IosDriver does not support xcode version 8.0. Apple has deprecated UIAutomation. Use the “XCUITest” automationName capability instead. (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 500 milliseconds
please help me out


#4

Hi Guys, Any idea why this error is coming.
[Xcode] Finding XcodePath by symlink because Error: Command ‘xcode-select --print-path’ errored out: Error: spawn xcode-select ENOENT

Appium version : 1.6.0
iPhone version : 9.3.5
Xcode : 8.0 (8A218a)
Mac OS : Sierra 10.12.1


#5

@pavanbachu
While when i am executing this command on Terminal i am able to get the xcode’s path
@Aleksei
Guys please help


#6

@crujzo:Where are you exactly struck ?


#7

@crujzo
hi. we are still with xCode 8.0 and El Captain and we do not use real device (last time i used was 1 year ago with old appium). i prefer wait for 2-3 months before migrating new version of xCode or OS X for sure to minimize problems :slight_smile:

here is our capabilities we use to start with iOS Simulator (some values migrated from appium 1.5.3 and DO NOT WORK with 1.6.X e.g. ‘waitForAppScript’. i just left while it does not hurt.):

Capabilities [{app=/Users/Aleksei/Downloads/test_clients/alpha.app, noReset=false, newCommandTimeout=120, platformVersion=10.0, automationName=Appium, browserName=, waitForAppScript=$.delay(3000); $.acceptAlert(); true;, version=, deviceName=iPhone 6s, fullReset=false, platform=MAC}]

i manipulate mostly with ‘noReset’ and ‘fullReset’ values before opening driver depending on need to reset client or not.

lets see example of code for iOS client (some variables i mention in testNG xml file and reading it inside test):

private static DesiredCapabilities capabilities = null;
protected static AppiumDriver driver;

if (deviceName.contains("iPhone")) capabilities = DesiredCapabilities.iphone();
else if (deviceName.contains("iPad")) capabilities = DesiredCapabilities.ipad();
capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, "Appium");
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, deviceName);
capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, "");
capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, osVersion);
capabilities.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, "120");
capabilities.setCapability("waitForAppScript","$.delay(3000); $.acceptAlert(); true;");

            if (devicePlatform.contains("fullReset")) { // reinstall client
                System.out.println("  Driver DO FULL-RESET");
                capabilities.setCapability(MobileCapabilityType.FULL_RESET, true);
                capabilities.setCapability(MobileCapabilityType.NO_RESET, false);
            } else if (devicePlatform.contains("fastReset")) { // clears cache without reinstall
                System.out.println("  Driver DO FAST-RESET");
                capabilities.setCapability(MobileCapabilityType.FULL_RESET, false);
                capabilities.setCapability(MobileCapabilityType.NO_RESET, false);
            } else {
                System.out.println("  Driver DO NORMAL start");
                capabilities.setCapability(MobileCapabilityType.FULL_RESET, false);
                capabilities.setCapability(MobileCapabilityType.NO_RESET, true);
            }

            File appDir = new File(userDir, fileName);
            capabilities.setCapability(MobileCapabilityType.APP, appDir.getAbsolutePath());
            driver = new IOSDriver(new URL(baseURL+port+minorURL), capabilities);

#8

Hi @Aleksei @pavanbachu Thanks for your support! :slight_smile:

I am trying to invoke iOSDriver through java code before that Appium server has already been started ->
[Appium] Welcome to Appium v1.6.0
[Appium] Non-default server args:
[Appium] address: '127.0.0.1’
[Appium] Appium REST http interface listener started on 127.0.0.1:4723
[HTTP] --> GET /wd/hub/status {}
[MJSONWP] Calling AppiumDriver.getStatus() with args: []
[MJSONWP] Responding to client with driver.getStatus() result: {“build”:{“version”:“1.6.0”…
**[HTTP] <-- GET /wd/hub/status 200 50 ms - 83 **
Appium server has started…

Now when invoking iOS drivers through following code :->

else if(platformInfoObject.PlatformName.equalsIgnoreCase(“iOS”)){

                    AppiumDriver<WebElement> driver = null;
                    DesiredCapabilities capabilities = new DesiredCapabilities();
                    capabilities.setCapability("automationName", "XCUITest");
                    capabilities.setCapability("platformName", platformInfoObject.PlatformName);
                    capabilities.setCapability("platformVersion", "9.3.5");
                    capabilities.setCapability("deviceName", "OIT-MIO00038");
                    capabilities.setCapability("udid", platformInfoObject.PlatformID);
                    capabilities.setCapability("newCommandTimeout", 900);
                    capabilities.setCapability("bundleId", "com.YYYYYY.XXXXXX");
                    capabilities.setCapability("autoAcceptAlerts", true);
                    capabilities.setCapability("noReset", true);
                    capabilities.setCapability("app", platformInfoObject.AppPath);
                    driver = new IOSDriver<WebElement>(new URL("http://"+platformInfoObject.ServerURL+":"+platformInfoObject.ServerPortNumber+"/wd/hub"), capabilities);
                    driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);
                    return driver;
                }

I am getting the following errors :

Nov 07, 2016 8:56:08 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Attempting bi-dialect session, assuming Postel’s Law holds true on the remote end
[HTTP] --> POST /wd/hub/session {“capabilities”:{“desiredCapabilities”:{“app”:"/Volumes/Automation/XXXXXX.ipa",“platformVersion”:“9.3.5”,“automationName”:“XCUITest”,“bundleId”:“com.YYYYYY.XXXXXX”,“platformName”:“iOS”,“udid”:“79XXXb8985cXXXXXXXXXXX2320eXXXXXXXXXXX3121c”,“deviceName”:“OIT-MIO00038”},“requiredCapabilities”:null},“desiredCapabilities”:{“app”:"/Volumes/Automation/XXXXXX.ipa",“platformVersion”:“9.3.5”,“automationName”:“XCUITest”,“bundleId”:“com.YYYYYY.XXXXXX”,“platformName”:“iOS”,“udid”:“79b89XXXXXXXXXXX7f32320eXXXXXXXXXXX3121c”,“deviceName”:“OIT-MIO00038”},“requiredCapabilities”:null}
[debug] [MJSONWP] Bad parameters: BadParametersError: Parameters were incorrect. We wanted {“required”:[“desiredCapabilities”],“optional”:[“requiredCapabilities”,“sessionId”,“id”]} and you sent [“capabilities”,“desiredCapabilities”,“requiredCapabilities”]
[HTTP] <-- POST /wd/hub/session 400 4 ms - 201 **
Nov 07, 2016 8:56:09 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Falling back to straight W3C remote end connection
[HTTP] --> POST /wd/hub/session {“capabilities”:{“desiredCapabilities”:{“app”:"/Volumes/Automation/XXXXXX.ipa",“platformVersion”:“9.3.5”,“automationName”:“XCUITest”,“bundleId”:“com.YYYYYY.XXXXXX”,“platformName”:“iOS”,“udid”:“79b8985cXXXXXXXXXXX2320ea6XXXXXXXXXXX21c”,“deviceName”:“OIT-MIO00038”},“requiredCapabilities”:null}}
[debug] [MJSONWP] Bad parameters: BadParametersError: Parameters were incorrect. We wanted {“required”:[“desiredCapabilities”],“optional”:[“requiredCapabilities”,“sessionId”,“id”,“sessionId”,“id”]} and you sent [“capabilities”]
[HTTP] <-- POST /wd/hub/session 400 2 ms - 173 **
Nov 07, 2016 8:56:09 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Falling back to original OSS JSON Wire Protocol.
[HTTP] --> POST /wd/hub/session {“desiredCapabilities”:{“app”:"/Volumes/Automation/XXXXXX.ipa",“platformVersion”:“9.3.5”,“automationName”:“XCUITest”,“bundleId”:“com.YYYYYY.XXXXXX”,“platformName”:“iOS”,“udid”:“79b8985c23XXXXXXXXf32320eaXxXXXXXXXX121c”,“deviceName”:“OIT-MIO00038”},“requiredCapabilities”:null}
[MJSONWP] Calling AppiumDriver.createSession() with args: [{“app”:"/Volumes/Automatio…
[Appium] Creating new XCUITestDriver session
[Appium] Capabilities:
[Appium] app: '/Volumes/Automation/XXXXXX.ipa’
[Appium] platformVersion: '9.3.5’
[Appium] automationName: 'XCUITest’
[Appium] bundleId: 'com.XXXXX.YYYYY’
[Appium] platformName: 'iOS’
[Appium] udid: '79b898XXXXX737f97f323QQQQQOOOOOKKKKK121c’
[Appium] deviceName: 'OIT-MIO00038’
[debug] [XCUITest] XCUITestDriver version: 2.0.26
[BaseDriver] Session created with session id: 7d523140-XXXX-49e0-XXXX-a8d2XXXXX822
[Xcode] Finding XcodePath by symlink because Error: Command ‘xcode-select --print-path’ errored out: Error: spawn xcode-select ENOENT
** at exports._errnoException (util.js:1026:11)

** at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)

** at onErrorNT (internal/child_process.js:359:16)**
** at _combinedTickCallback (internal/process/next_tick.js:74:11)**
** at process._tickCallback (internal/process/next_tick.js:98:9)**
[debug] [XCUITest] Xcode version set to '8.1’
[XCUITest] Error: Could not determine [debug] [XCUITest] Running iOS simulator reset flow
[HTTP] <-- POST /wd/hub/session 500 230 ms - 172 **
iOS SDK version
** at Object.wrappedLogger.errorAndThrow (lib/logger.js:60:13)

** at getAndCheckIosSdkVersion$ (lib/utils.js:54:9)**
** at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)**
** at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)**
** at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)**
** at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)**
** at process._tickCallback (internal/process/next_tick.js:103:7)**
** Error: Could not determine iOS SDK version**
** at Object.wrappedLogger.errorAndThrow (lib/logger.js:60:13)**
** at getAndCheckIosSdkVersion$ (lib/utils.js:54:9)**
** at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)**
** at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)**
** at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)**
** at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)**
** at process._tickCallback (internal/process/next_tick.js:103:7)**

It says “Could not determine iOS SDK version” via xcode-select --print-path

Whereas when i open terminal and check the above command i gives me the XCode installation dir. path as shown in the screenshot

Appium version : 1.6.0
iPhone version : 9.3.5 or 10.0.1
Xcode : 8.1
Mac OS : Sierra 10.12.1

The same framework works well with Android but facing issue in iOS.

Please help me to know what wrong i am doing?


#9

Thanks every one the support.

The issue is resolved now.

I had to set “/usr/bin/xcode-select” to my PATH Environment variable in Eclipse after which it started recognizing xcode-select.

Thanks @Aleksei and @pavanbachu for bearing with me :slight_smile:


#10

how u had set path
can u provide steps


#11

could you please update the steps to resolve this issue