This project contains two scripts, though you'll only ever have to use the Python script.
Basically, it automates the entirety of the UiAutomator pipeline, from creating the test with the android command, to building it, to pushing it to the device, and finally to running it.
Furthermore, you can run as many UiAutomator projects at once as you wish.
python UiAutomator.py -p <PROJECT_PATHS> -c <PACKAGE_NAMES>
(Don't ask about the -c argument; it's Android's convention)
Or for the linux executable (must have python2 installed):
./UiAutomator -p <PROJECT_PATHS> -c <PACKAGE_NAMES>