when (platform) { Platform.Android -> AndroidDriver(URL(remoteAddressUrl), DesiredCapabilities().apply { setCapability("platformName", MobilePlatform.ANDROID) setCapability("platformVersion", "7.0") setCapability("deviceName", "deviceName") setCapability("app", “Application.app") setCapability("avd", "Pixel") setCapability("fullReset", "true") setCapability("automationName", "UiAutomator2") }) Platform.IOS -> IOSDriver(URL(remoteAddressUrl), DesiredCapabilities().apply { setCapability("platformName", MobilePlatform.IOS) setCapability("platformVersion", "12.1") setCapability("deviceName", "iPhone XR") setCapability("app", “Application.apk") setCapability("newCommandTimeout", 150) setCapability("fullReset", true) }) }