mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-02 19:17:10 +00:00
fix(sidecar): use LocalIOSDevice (WDA+simctl) + stop before relaunch
This commit is contained in:
1 parent
f1fba36a28
commit
5b7415d2ea
3 files changed
+22
-5
No files matched your search
@@ -503,12 +503,15 @@ class IosDriverBackend(private val udid: String) : DriverBackend {
|
||||
false,
|
||||
)
|
||||
val xcTestDriverClient = xcuitest.XCTestDriverClient(installer, httpClient, false)
|
||||
val device = ios.xctest.XCTestIOSDevice(udid, xcTestDriverClient) { emptySet() }
|
||||
val xcTestDevice = ios.xctest.XCTestIOSDevice(udid, xcTestDriverClient) { emptySet() }
|
||||
val simctlDevice = ios.simctl.SimctlIOSDevice(udid)
|
||||
val device = ios.LocalIOSDevice(udid, xcTestDevice, simctlDevice, maestro.utils.NoopInsights)
|
||||
driver = maestro.drivers.IOSDriver(device, maestro.utils.NoopInsights, metrics)
|
||||
driver.open()
|
||||
}
|
||||
|
||||
override fun launch(bundleId: String, clearState: Boolean, env: Map<String, String>) {
|
||||
runCatching { driver.stopApp(bundleId) }
|
||||
if (clearState) driver.clearAppState(bundleId)
|
||||
driver.launchApp(bundleId, env, java.util.UUID.randomUUID())
|
||||
}
|
||||
|
||||
@@ -150,7 +150,9 @@ class DriverService(
|
||||
observer.onNext(block())
|
||||
observer.onCompleted()
|
||||
} catch (cause: Exception) {
|
||||
observer.onError(cause)
|
||||
cause.printStackTrace()
|
||||
observer.onError(io.grpc.Status.INTERNAL.withDescription(cause.toString())
|
||||
.withCause(cause).asRuntimeException())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user