My partner posted this for me, I'm really proud of this because its written in OCaml and its a great example of real world functional programming.
Tangentially, I think you can do this without Jailbreaking via services like : https://www.appaloosa-store.com/. Or maybe http://bumaociyuan.github.io/ios/2015/07/17/self-signed-cert... and https://github.com/bumaociyuan/zxIpaServer though I might be wrong. (I.e., you no longer need to to JB, you an just put the signed .ipa on a website and it will install.) I haven't had an iPhone in years to test it, but I'd be interested to know.