ADB Receive broadcast BOOT_COMPLETE

前端 未结 3 1352
借酒劲吻你
借酒劲吻你 2020-12-05 22:20

I want to wait until the android mobile phone has started and the MediaScanner is done.

Afterwards I want to perform an action using adb.

adb wait-for-devic

3条回答
  •  眼角桃花
    2020-12-05 22:59

    If your device does not have busybox installed (see shell script in android gives [: not found), you can try to iterate in your computer. Something like this would work:

    while [ `adb shell getprop dev.bootcomplete` -nq "1" ] ; do sleep 1; done
    

    If your device have busybox installed, you can proceed as Alex P. commented:

    adb shell 'while [ ""`getprop dev.bootcomplete` != "1" ] ; do sleep 1; done'
    

    Of course the syntax depends on your machine (POSIX, etc).

提交回复
热议问题