Cloud and parallel execution
For parallel or multi‑device execution, use a cloud provider such as BrowserStack, Sauce Labs, or LambdaTest. The integration point is the driver factory - point it at the cloud hub URL with the appropriate capabilities:
object MyCloudApp : AndroidApp(
appPackage = "com.example.app",
driverFactory = {
AndroidDriver(
URI("https://hub-cloud.browserstack.com/wd/hub").toURL(),
UiAutomator2Options().apply {
setCapability("bstack:options", mapOf(
"userName" to System.getenv("BROWSERSTACK_USERNAME"),
"accessKey" to System.getenv("BROWSERSTACK_ACCESS_KEY"),
"deviceName" to "Samsung Galaxy S22 Ultra",
"platformVersion" to "12.0",
))
},
)
},
)
Everything else - test harness, screens, navigation - works identically regardless of whether the driver connects to a local or remote server.