Added iOS build targets.
Extracted the script in it's own file.
Fixed bugs in the build script. Added check for existing binary.
Removed input and output files since they don't seem to work as I had hoped.
Change ARCHS not to be hardcoded.