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
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).