maestro: [1.34.1] MaestroDriverStartupException$IOSDriverTimeoutException

Describe the bug The issue occurs when running a Flow.

To Reproduce Steps to reproduce the behavior :

  1. Start the simulator
  2. Run maestro test ./flows // (flows is a folder with all my .yml)
  3. The Flow fails at Maestro iOS driver did not start up in time.

Expected behavior The error is not occurs

Screenshots maestro.MaestroDriverStartupException$IOSDriverTimeoutException: Maestro iOS driver did not start up in time at maestro.drivers.IOSDriver.awaitLaunch(IOSDriver.kt:476) at maestro.drivers.IOSDriver.open(IOSDriver.kt:65) at maestro.Maestro$Companion.ios(Maestro.kt:585) at maestro.cli.session.MaestroSessionManager.createIOS(MaestroSessionManager.kt:309) at maestro.cli.session.MaestroSessionManager.createMaestro(MaestroSessionManager.kt:154) at maestro.cli.session.MaestroSessionManager.access$createMaestro(MaestroSessionManager.kt:49) at maestro.cli.session.MaestroSessionManager$newSession$session$1.invoke(MaestroSessionManager.kt:82) at maestro.cli.session.MaestroSessionManager$newSession$session$1.invoke(MaestroSessionManager.kt:81) at maestro.cli.db.KeyValueStore.withExclusiveLock(KeyValueStore.kt:37) at maestro.cli.session.SessionStore.withExclusiveLock(SessionStore.kt:74) at maestro.cli.session.MaestroSessionManager.newSession(MaestroSessionManager.kt:81) at maestro.cli.session.MaestroSessionManager.newSession$default(MaestroSessionManager.kt:58) at maestro.cli.command.TestCommand.call(TestCommand.kt:136) at maestro.cli.command.TestCommand.call(TestCommand.kt:46) at picocli.CommandLine.executeUserObject(CommandLine.java:1933) at picocli.CommandLine.access$1200(CommandLine.java:145) at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2332) at picocli.CommandLine$RunLast.handle(CommandLine.java:2326) at picocli.CommandLine$RunLast.handle(CommandLine.java:2291) at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2159) at maestro.cli.DisableAnsiMixin$Companion.executionStrategy(DisableAnsiMixin.kt:22) at picocli.CommandLine.execute(CommandLine.java:2058) at maestro.cli.AppKt.main(App.kt:117)

Environment information (please complete the following information):

  • Maestro version 1.34.1
  • Platform: iOS 17.0.1
  • Framework: React Native
  • Device model and OS version: iPhone14
  • Simulator
  • Host Mac M1 Pro
  • Mac OS Sonoma 14.1 (23B74)

Additional context

After many attempts, it freezes the simulator.

About this issue

  • Original URL
  • State: open
  • Created 8 months ago
  • Reactions: 31
  • Comments: 18

Most upvoted comments

Having same problem on v1.36.0:

maestro.MaestroDriverStartupException$IOSDriverTimeoutException: Maestro iOS driver did not start up in time
maestro.MaestroDriverStartupException$IOSDriverTimeoutException: Maestro iOS driver did not start up in time
	at maestro.drivers.IOSDriver.awaitLaunch(IOSDriver.kt:480)
	at maestro.drivers.IOSDriver.open(IOSDriver.kt:64)
	at maestro.Maestro$Companion.ios(Maestro.kt:596)
	at maestro.cli.session.MaestroSessionManager.createIOS(MaestroSessionManager.kt:309)
	at maestro.cli.session.MaestroSessionManager.createMaestro(MaestroSessionManager.kt:154)
	at maestro.cli.session.MaestroSessionManager.access$createMaestro(MaestroSessionManager.kt:49)
	at maestro.cli.session.MaestroSessionManager$newSession$session$1.invoke(MaestroSessionManager.kt:82)
	at maestro.cli.session.MaestroSessionManager$newSession$session$1.invoke(MaestroSessionManager.kt:81)
	at maestro.cli.db.KeyValueStore.withExclusiveLock(KeyValueStore.kt:37)
	at maestro.cli.session.SessionStore.withExclusiveLock(SessionStore.kt:74)
	at maestro.cli.session.MaestroSessionManager.newSession(MaestroSessionManager.kt:81)
	at maestro.cli.command.StudioCommand.call(StudioCommand.kt:51)
	at maestro.cli.command.StudioCommand.call(StudioCommand.kt:19)
	at picocli.CommandLine.executeUserObject(CommandLine.java:1933)
	at picocli.CommandLine.access$1200(CommandLine.java:145)
	at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2332)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2326)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2291)
	at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2159)
	at maestro.cli.DisableAnsiMixin$Companion.executionStrategy(DisableAnsiMixin.kt:22)
	at picocli.CommandLine.execute(CommandLine.java:2058)
	at maestro.cli.AppKt.main(App.kt:117)

I’ve tried many different things but the only way I can get it to work again is to completely restart my mac.


Edit:

I at least found a way to get maestro working again after the iOS Driver error starts, without resorting to restarting the entire computer. It appears that even when maestro is run and/or shutdown correctly, it sometimes leaves stray iOS Driver processes running. I found that maestro starts working again after finding then killing these processes (usually 2):

ps aux | grep maestro
# 92127  /Users/user4934/Library/Developer/CoreSimulator/Devices/AC713017-4F72-7303-5652-498575F61EC3/data/Containers/Bundle/Application/935FA456-B60F-26CE-3B17-BCD2AED7E37B/maestro-driver-iosUITests-Runner.app/maestro-driver-iosUITests-Runner

# 92092  /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild test-without-building -xctestrun /var/folders/bs/fylysjxs3z9g14bh79r68rqc0000gn/T/AC713017-4F72-7303-5652-498575F61EC3/maestro-driver-ios-config.xctestrun -destination id=AC713017-4F72-7303-5652-498575F61EC3 -derivedDataPath /var/folders/bs/sylysjxs3z9g14bh79r68rqc0000go/T/maestro_xctestrunner_xcodebuild_output3578906104202179615


# Then kill those processes:
kill 92092 92127

Edit:

Here’s a one liner to kill the processes more easily:

pgrep -lf maestro | awk '{print $1}' | xargs -r kill

Having this same problem mainly on v1.35.0, this was previously intermittent on v1.34.1.

I faced the same problem when running Maestro on CI. It went away when I increased the driver’s timeout from 15s to 60s. The following is from the Maestro docs on how to do this: https://maestro.mobile.dev/advanced/configuring-maestro-driver-timeout

export MAESTRO_DRIVER_STARTUP_TIMEOUT=60000 # setting 60 seconds
maestro test file.yaml

Thanks, but I already try that too. It doesn’t change, same error : maestro.MaestroDriverStartupException$IOSDriverTimeoutException: Maestro iOS driver did not start up in time

After updating iOS 17.4 and Xcode 15.3 in the CI (Codemagic), Maestro now works flawlessly. Not sure of the reason but wanted to share my experience.