Capabilities for iOS automation in Appium

Here are some of the capabilities you can pass.

  1. platformName
  2. platformVersion
  3. deviceName
  4. app
  5. bundleId
  6. safariAllowPopups
  7. autoAcceptAlerts

Here is the sample code to launch the app on iPhone 6 on iOS 9.

DesiredCapabilities cap = new DesiredCapabilities();
cap.setCapability("platformName", "iOS");
cap.setCapability("platformVersion", "9.0");
cap.setCapability("deviceName", "iPhone 6"); 
cap.setCapability("app", /usr/my.app"); 

To run tests on safari browser, you will have to pass below capability.

capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, “Safari”);

In the device name, you can give values like iPhone 4s, iPhone 5, iPhone 5s, iPhone 6, iPhone 6 Plus, iPhone 6s, iPhone 6s Plus, iPad 2, iPad Retina, iPad Air, iPad Air 2, iPad Pro etc. depending upon what all simulators are available in your Xcode.

If you want to automate the app on real iOS device, you need to pass below capability.

capabilities.setCapability(MobileCapabilityType.UDID, “fhg87878hjhj86”);

You may also like...