I thought I would kick off a series on tips, trick and speed ups for those using titanium from the terminal. I use vim/tmux for all my tidev, but none of these posts will assume you do the same. If you are reading this I am going to assume that you are already pretty familiar with the titanium cli.
Distribution builds can, understandably, take some time. You will probably turn your attention to other things while you wait. It is really handy to get a notification when the build is complete. I’m going to show how one OS X.
terminal-notifier “is a command-line tool to send Mac OS X User Notifications, which are available in Mac OS X 10.8 and higher.” If you have brew installed you can install it like this:
$ brew install terminal-notifier
Have a look at the link above to understand all the options available.
The simplest way to get notified after a build is, e.g. as follows:
$ titanium build -p android -T device -b && terminal-notifier -sound default -message "Android Build Complete"
Or if you head to the kitchen you can be notified by email:
$ titanium build -p android -T device -b && (echo "Get back to work" | mail -s "Android Build Done" email@example.com)
If you have already kicked off the long process and still want to be notified, first press
ctrl-z to put the process in the background and then type:
wait %1 ; terminal-notifier -sound default -message "Android Build Complete"
Credits to @climagic for the last technique.