Capabilities for iOS automation using appium

Here are some of the capabilities you can pass.
  • platformName
  • platformVersion
  • deviceName
  • app
  • bundleId
  • safariAllowPopups
  • 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/");  

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”);

Web development and Automation testing

solutions delivered!!