Flash hex code from Swift App

I posted this a couple of days ago in the Arduino 101 forum and got no responses, so I'm trying here.

I have a swift IOS app based on blockly that will produce and compile Arduino code. I want to be able to flash the compiled code to either the Arduino 101 or another Bluetooth capable board from the app.

I believe I can trigger the board to go into bootloader mode, but I don't know how to send the compiled code.

Is there some way to use AVRDude (or equivalent) to send my compiled code from my swift app?