System Config with below versions -
Mac OS - 10.12 Xcode - 8.0 Appium - 1.5.3
Below is the script which trying to run:-
public class testclass {
public static AppiumDriver<WebElement> driver;
public static void main(String[] args) throws MalformedURLException {
// TODO Auto-generated method stub
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("platformName", "iOS");
capabilities.setCapability("platformVersion", "8.1");
capabilities.setCapability("deviceName", "iphone 6" );
capabilities.setCapability("app", "settings");
driver = new IOSDriver<WebElement>(new URL ("http://0.0.0.0:4723/wd/hub"), capabilities);
driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);
driver.close();
}
}
Error As Exception -
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session. desired capabilities = Capabilities [{app=settings, platformVersion=8.1, platformName=iOS, deviceName=iphone 6}], required capabilities = Capabilities [{}] Build info: version: 'unknown', revision: '1969d75', time: '2016-10-18 09:43:45 -0700' System info: host: 'INCDSZPC02604.local', ip: '3.209.248.73', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.1', java.version: '1.8.0_112' Driver info: driver.version: IOSDriver at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:91) at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:141) at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:69) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601) at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:40) at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1) at io.appium.java_client.ios.IOSDriver.execute(IOSDriver.java:1) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:241) at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:128) at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:141) at io.appium.java_client.DefaultGenericMobileDriver.(DefaultGenericMobileDriver.java:36) at io.appium.java_client.AppiumDriver.(AppiumDriver.java:114) at io.appium.java_client.AppiumDriver.(AppiumDriver.java:132) at io.appium.java_client.ios.IOSDriver.(IOSDriver.java:82) at MobileDemo.testclass.main(testclass.java:22)