IOS code.
import java.net.MalformedURLException; import java.net.URL; import java.util.concurrent.TimeUnit; import org.openqa.selenium.remote.DesiredCapabilities; import io.appium.java_client.ios.IOSDriver; import io.appium.java_client.ios.IOSElement; import io.appium.java_client.remote.AutomationName; import io.appium.java_client.remote.MobileCapabilityType; public class First { public static void main(String[] args) throws MalformedURLException { DesiredCapabilities cap = new DesiredCapabilities(); cap.setCapability(MobileCapabilityType.DEVICE_NAME, "iPhone 6"); cap.setCapability(MobileCapabilityType.PLATFORM_NAME, "iOS"); cap.setCapability(MobileCapabilityType.AUTOMATION_NAME, AutomationName.IOS_XCUI_TEST); cap.setCapability(MobileCapabilityType.APP, "//Users/xcodeclub/Desktop/UICatalog.app"); IOSDriver<IOSElement>driver = new IOSDriver(new URL("http://127.0.0.1:4723/wd/hub"),cap); driver.manage().timeout