Codesigning OS X Apps - Build Automation

I would like to codesign my application on build but am having difficulty. In the manual, it states I can create a Build Script containing:

DoShellCommand "codesign -f -s ""DEV ID""  ""MyApp.app"""

When I fill in the proper values and build, I get an error: “IDE Script Compile Error - Compiler error [31] Error found while compiling on line 1. Continue?”

I can codesign my app just fine from the command line. I have triple checked my arguments at the shell vs what I put in my build script and they match. I have tried all sorts of variants using $PROJECT_PATH, adding in the Builds - App Name.xojo_project/Mac OS X (Cocoa Intel)/MyApp.app type scenarios.

Any thoughts on how to accomplish this?

DoShellCommand returns a string value, so you’ll need to either prefix it with Call to ignore it or assign it to a variable.

Ah, OK… So, this is what I wound up with (that works):

Call DoShellCommand "codesign -f -s ""MYMACDEVID"" ""$PROJECT_PATH/Builds -MyApp.xojo_project/Mac OS X (Cocoa Intel)/MyApp.app"""

http://www.realsoftwareblog.com/2012/08/improve-your-build-process.html is where I got my original information, not the manual, sorry. Book 4 does show how to codesign, but does not show the build automation, was getting my sources mixed up.

I’ve updated the blog post to fix the DoShellCommand syntax error.

interesting what whitespace or the lack of it can do to a word (or use of - )

codesigning

co-designing?
or
code-signing

:slight_smile: