Using ditto on macOS

Recently I was investigating why this command returned a not authorised response:

spctl --verbose --assess --type execute --v ${fileName}.app

Turns out because I zipped the .app file like this:

zip -r zipped-file ${fileName}.app

This causes spctl to no longer find the correct notarized details.

Using ditto is a better solution:

ditto -c -k --sequesterRsrc --keepParent ${fileName}.app

Oh and by the way, do not use jar xf to unzip the file, instead use plain unzip or ditto if you don’t want spctl to complain.