I made two changes here:
1) Added an optional UDID command line parameter for running tests on the device
2) Made the path to the Automation template independent of whether you're running Xcode 4.2 or 4.3
I don't actually have 4.2 installed on this machine to check that the path I use also works on that. I assume the xcode select works correctly though.
Modified to use device ID so it runs on device not simulator
Made path to trace template independent of Xcode version (4.2 vs 4.3)
Made running on device (by supplying device id) optional