Uploading hex to Arduino Leonardo, script?

Hello,

I have product that is based on Atmega32u4 with Leonardo bootloader. I need to flash large quantity of these chips without exposing my code.

I thought Xloader is good tool for this but I need put device in bootloader mode before uploading HEX file. To put it in bootloader mode I need to open port, start communication at 1200bps and then close it. At this point I have 8 seconds to upload code. It can be time consuming job to flash large quantity of devices.
Any tip to make script that can do it with less steps?

I found great solution:
Arduino Builder
http://forum.arduino.cc/index.php?topic=151774.0

Works great :slight_smile: