spctl is not a great way to check whether a program will run. Rather, I recommend that you do an end-to-end test, as explained in Testing a Notarised Product. Oh, and two minor things. First, when you run an assessment with spctl you have to pass in the correct assessment type via the -t option. install is not correct for command-line tools. You want to use exec. Second, I noticed you’re signing code with sudo. That’s something we specifically recommend against. See Creating distribution-signed code for macOS. In many cases it’ll work, but it also send you off into the errSecInternalComponent weeds. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com
Topic:
Code Signing
SubTopic:
Certificates, Identifiers & Profiles