Issue
I'm launching a Genymotion VM using:
$ /Applications/Genymotion.app/Contents/MacOS/player --vm-name <VM_ID> &
$ sleep 30
Is there a way to know when Android's ready to install & launch an app instead of just waiting 30s?
adb devices
lists the VM in the very early boot process, so I can't rely on it.
Solution
Since adb
works, you can simply check for one of the following properties:
sys.boot_completed
init.svc.bootanim
dev.bootcomplete
Sample code to poll on the target:
adb shell 'while [ ""`getprop dev.bootcomplete` != "1" ] ; do sleep 1; done'
Sample code to poll target from the host:
while [ `adb shell getprop sys.boot_completed` -nq "1" ] ; do sleep 1; done
Alternately, you could simple parse the output of adb logcat
for a specific log/keyword that occurs at the point of time you want to track.
Answered By - TheCodeArtist
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.