Warm tip: This article is reproduced from serverfault.com, please click

Detect when Android emulator is fully booted

发布于 2010-09-03 08:15:57

I want to create a script where I start an emulator and after the system is fully booted, I want to install an .apk.

How can I know when the emulator is fully booted so I can run the install command? Here http://developer.android.com/guide/developing/tools/adb.html it is said that adb wait-for-device install <app>.apk is not correct.

So how can I achieve this? Is it possible? Is my only option to sleep for a few minutes until I can be sure that the emulator is started?

Questioner
Catalin Morosan
Viewed
0
neuron 2013-01-30 21:12:25

adb shell getprop init.svc.bootanim

This will tell you whether or not the boot animation is running. It's what we use on our headless build server to check if the emulator is up. The sys.boot_completed from dac2009 is what lead me to find that flag. We use init.svc.bootanim instead because boot_completed has a tendency of triggering too early.