Resolve installation problems with emulator cold start

Installation would fail on an emulator cold start. This now waits for
the emulator to come online before proceeding with the installation on a
cold start. Also there is now installation success check in place.
Installation success check introduced utility
TextDetectingStreamListener which is used by XCodeBuild as well.