fix(sidecar): pick free WDA port instead of hardcoded 9100

Use SocketUtils.nextFreePort to pick a free port in the 22000-23000 range
rather than hardcoding 9100, which only worked if a previous WDA session
left a listener there.
This commit is contained in:
pj committed 2026-04-23 16:34:19 +07:00
1 parent a70c865afa
commit 73dc7948ab
1 file changed
+2 -1
@@ -492,11 +492,12 @@ class IosDriverBackend(private val udid: String) : DriverBackend {
init {
val httpClient = xcuitest.api.OkHttpClientInstance.get()
val metrics = maestro.utils.NoOpMetrics()
val wdaPort = maestro.utils.SocketUtils.nextFreePort(22000, 23000)
val installer = xcuitest.installer.LocalXCTestInstaller(
udid,
"localhost",
false,
9100,
wdaPort,
metrics,
httpClient,
false,