UIAutomation vs XCUITest: How to declare capability

Some versions of IOS will allow both UIAutomation and XCUITest to be used. Assume I want XCUITest only, would I use capabilities to make this declaration ? Please answer by providing example of command that would make this happen. thnx

You should try:
dc.setCapability(“automationName”, “UIAutomation”);

and for XCUITest would I use ?

dc.setCapability(“automationName”, “XCUITest”);

XCUITest is the default automation framework that we use for iOS 9.1 and above
you don’t need to add any capability if you want to use XCUITest