From a936f83921e999a3a454a0c0af81da1469ee3100 Mon Sep 17 00:00:00 2001 From: Sergii Pechenizkyi Date: Thu, 7 Mar 2019 15:48:26 +0100 Subject: [PATCH] Wait for dev.bootcomplete property on emulator launch Fetch dev.bootcomplete instead of init.svc.bootanim to allow -no-boot-anim start option. --- swarmer/src/main/kotlin/com/gojuno/swarmer/Emulators.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/swarmer/src/main/kotlin/com/gojuno/swarmer/Emulators.kt b/swarmer/src/main/kotlin/com/gojuno/swarmer/Emulators.kt index fdf26ba..36e45af 100644 --- a/swarmer/src/main/kotlin/com/gojuno/swarmer/Emulators.kt +++ b/swarmer/src/main/kotlin/com/gojuno/swarmer/Emulators.kt @@ -310,7 +310,7 @@ private fun waitForEmulatorToFinishBoot( adb, "-s", emulator.id, "shell", - "getprop", "init.svc.bootanim" + "getprop", "dev.bootcomplete" ), timeout = 10 to SECONDS, redirectOutputTo = outputDirectory(args), @@ -318,9 +318,9 @@ private fun waitForEmulatorToFinishBoot( ) .filter { it is Notification.Exit } .cast(Notification.Exit::class.java) - .map { it.output.readText().contains("stopped", ignoreCase = true) } - .switchMap { bootAnimationStopped -> - if (bootAnimationStopped) { + .map { it.output.readText().contains("1", ignoreCase = true) } + .switchMap { bootCompleted -> + if (bootCompleted) { Observable.just(targetEmulator) } else { Observable.never()