Compiling in Release Mode on MacOS XCode
Copy link to clipboard
Copied
Hi gang;
I have done a lot of research but I still can't get an official answer. I want to make sure I am compling in release mode as opposed to debug mode for distribution.
This thread says to do so by selecting "Product" Menu => "Build For" => "Profiling" - https://stackoverflow.com/questions/21897728/how-to-toggle-running-xcode-project-in-debug-or-release...
This thread says (and a few others) to select "Product => Archive" It seems to be for IOS but probably applies to MacOS as well - https://stackoverflow.com/questions/5706548/how-do-i-create-a-release-build-in-xcode
Finally, this thread (and several others) say to edit the scheme - https://pinkstone.co.uk/deploying-your-app-from-xcode-to-a-device-with-release-build-configuration/
As you can see there is a lot of conflicting information. I have been doing "Product" Menu => "Build For" => "Profiling" and I distributed to some testers and it worked on their machines. But I want to be 100% sure, especially for the speed gain in release mode.
Could someone please offer some guidance to this so that we have it in a post for once and for all?
Thanks in advance,
-Richard
Copy link to clipboard
Copied
Any suggestions or advice?
I have been told that the way to do this is to edit the scheme for the project and make the changes from 'Debug' to 'Release'. However, 'Release' is not available as an option. 'Debug' is the ONLY option available.
-Richard
Copy link to clipboard
Copied
Are you trying to develop a plug-in for After Effects? Sorry, I'm a little confused. XCode doesn't directly have anything to do with AE.
Copy link to clipboard
Copied
Yes, that's why I tagged the post SDK.
-Richard
Copy link to clipboard
Copied
Hi Richard.
on mac, the "build for" compile options are just names. you can dupliace your debug configuration and rename it "release" as described in this link:
https://shockoe.com/ideas/development/how-to-setup-configurations-and-schemes-in-xcode/
once you have a release configuration you can set the "build for" inspection/archive/whatever to use the release config.
on mac, the release and debug configs differ mostly in the optimization definitions (i.e. optimize fastest/smallet ect). that is why your debug-compiled plug-in worked on non-dev machines.
Copy link to clipboard
Copied
Thank you Shachar - this is very, very helpful information. I will go and do some tests.
"on mac, the release and debug configs differ mostly in the optimization definitions (i.e. optimize fastest/smallet ect). that is why your debug-compiled plug-in worked on non-dev machines."
Does the above statement mean that unlike Windows where a release mode-compiled app runs MUCH faster than a debug mode one, it is not so on Mac, where the main differences are only in the compiled plugin size?
Thanks,
-Richard
Copy link to clipboard
Copied
speed is mostly about optimization settings. however, on windows when compiling debug, the plug-in will be dependent on other debug components that are not available on a non-dev machine. so on windows a debug compiled plug-in wouldn't run at all on a non-dev machine.

