On Mac OS X, you can create a zip archive from the Finder by selecting some files and selecting \"Compress\" from the contextual menu or the File menu. Unfortunately, the r
man ditto states:
The command: ditto -c -k --sequesterRsrc --keepParent src_directory archive.zip will create a PKZip archive similarly to the Finder's Compress functionality.
notice --keepParent
I have a ruby script that makes iPhone App Store builds for me, but the zips it was generating wouldn't get accepted by iTunes Connect. They were accepted if I used Finder's "Compress" function.
millenomi's answer came close for me, but this command is what ended up working. iTunes Connect accepted my build, and the app got approved and can be downloaded no problem, so it's tested.
ditto -c -k --sequesterRsrc --keepParent AppName.app AppName.zip
Use the ditto command-line tool as follows:
ditto -ck --rsrc --sequesterRsrc folder file.zip
See the ditto man page for more.
The clue's in the tag 'automation'.
Create an action in Automator.app that uses the 'Create Archive' action, invoke it from the command-line (see 'automator').