Appium 1.6.0 with xCode 8 and iOS <= 9.2

Hi All,

Preconditions: I have preinstalled Appium 1.6.0 and xCode 8.0 on my Mac (and all the stuff from https://github.com/appium/appium-xcuitest-driver#appium-xcuitest-driver).

So, did I get it right: as Apple removed UIAutomation from xCode 8 and replaced it with XCUITest, I will not be able to test apps on iOS emulators <= 9.2? The only way to run tests on iOS emulators <= 9.2 is to downgrade xCode to 7.X version? And using set from “preconditions” I will be able to run tests only on iOS simulators >= 9.3?

Thank you,
Artem

1 Like

Hi Artem, I upgraded one testing device to iOS 10 yesterday and have been working through all the steps necessary to once again run my tests via Appium 1.6.

You are correct in that you cannot test on simulators running iOS 9.2 or lower with Appium 1.6 and xCode 8. The workaround for this is to install multiple versions of xCode and use the xcode-select command to switch which version your command line tools use.

For example, in my /Applications folder, I have a folder called Xcode7-3 where I keep an install of xCode 7.3, and I have xCode 8.0 installed in its default location of /Applications/Xcode.app

When I need to run on a simulator with iOS 9.2 or lower, I run the command sudo xcode-select -s /Applications/Xcode7-3/Xcode.app/Contents/Developer to switch my command line tools to xCode 7.3. When testing on iOS 9.3 or higher, I switch back to xCode 8.0 by running sudo xcode-select -s /Applications/Xcode.app/Contents/Developer to switch the command line tools back to xCode 8. By doing this, I am able to run tests on simulators running iOS 9.2 and below, and iOS9.3 and above.

I hope this helps you

1 Like

That could help. Thanks for the feedback, will try.

Do cause any test run error if we use different versions of xcode based on iOS versions?

Especially, do we need to write different xpath values for different test runs in different versions?

Thanks,
Sanoj

Hi phallwurst, I tried Xcode7.3 and Xcode7.2. Both throw error: [XCUITest] Error: Platform version must be 9.3 or above. ‘9.2’ is not supported. I am using Appium 1.6.3. So which version of Appium I can use? or is there any workaround to run the test on iOS9.2 on real device?

You cannot use the XCUITEST framework with XCODE 7.X you must use XCODE 8.

If I try to run parallel tests on 2 devices, the first with iOS 9.1 and the second with iOS 10. It would be possible to set the first to use xcode7 and the second to use xcode8 at the same time?

1 Like