Last Updated: February 25, 2016
·
813
· yigit

Get sound notification when your app is ready on device after compilation

I hate the fact that Android clean compile takes close to 1 minute and I cannot help myself to read Hacker News while it is compiling.
To go back to my testing as soon as app is ready, I added a say command task after run on device task ends.

<target name="talk" description="uses mac say command to let us know sth happened">
    <exec executable="say">
        <arg value="-v"/>
        <arg value="Cellos"/>
        <arg value="${msg}"/>
    </exec>
</target>

and my run task is (which is executed after install)

<target name="run" description="run app on the connected device">
    <exec executable="${sdk.dir}/platform-tools/adb">
        <arg value="shell"/>
        <arg value="am start -a android.intent.action.MAIN -n com.example/.activities.MainActivity"/>
    </exec>
    <antcall target="talk">
        <param name="msg" value="App ready on device Dum dum dum dum dum dum dum App ready on device he he he ho ho ho"/>
    </antcall>
</target>