检测时,Android模拟器完全启动后, [英] Detect when Android emulator is fully booted
问题描述
我想创建一个脚本,我开始仿真器和之后的系统完全引导,我想安装一个.apk文件。
I want to create a script where I start an emulator and after the system is fully booted, I want to install an .apk.
我怎么能知道什么时候模拟器完全启动后,这样我就可以运行安装的命令?在这里,<一个href="http://developer.android.com/guide/developing/tools/adb.html">http://developer.android.com/guide/developing/tools/adb.html据说 ADB等待换设备的安装和LT;应用&GT;。.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?
推荐答案
这会告诉你开机动画是否运行。这就是我们使用无头的构建服务器上检查仿真器了。在从dac2009 sys.boot_completed是什么使我发现标志。我们使用init.svc.bootanim,而不是因为boot_completed有触发太早的趋势。
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.
这篇关于检测时,Android模拟器完全启动后,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!