Building for mac as a intel x64

I have a custom build system in place that is used from jenkins to build the game automatically for all of the platforms I want.

Through this, I can build the game for windows, linux and anything else I want with fairly customizable settings for each build. When it comes to mac builds, the only type of build I can make is a universal build for both intel x64 and apples silicon, which is BuildTarget.StandaloneOSX.

My question is how to only build for intel x64 as I’m using steam for my game and there are no apple silicon binaries for it.

I can see it’s possible to do it through the traditional build menu, I can pick intel x64, apple silicon or both/universal. So how can I do it through script.

I’m using unity 2020.2.1f1

I think perhaps it’s accessed via this:

https://docs.unity3d.com/ScriptReference/EditorUserBuildSettings.GetPlatformSettings.html

(and its corresponding SetPlatformSettings method)

I base that thought on:

1 Like

Hey Kurt,

That is military grade info.

I’ve figured out that I can control the correct target by using one of these. Thank you so much.

EditorUserBuildSettings.SetPlatformSettings( “OSXUniversal”, “Architecture”, “x64” ); // intel
EditorUserBuildSettings.SetPlatformSettings( “OSXUniversal”, “Architecture”, “ARM64” ); // arm
EditorUserBuildSettings.SetPlatformSettings( “OSXUniversal”, “Architecture”, “x64ARM64” ); // universal

2 Likes

Haha, thanks for coming back and replying with the remainder of the military secrets above. You never know who will find this in the future and go “AHA!”

Hi, I tried using this solution on Unity 2020.3.15f2 but still can’t get the Universal build… I did it the following way. Any help would be great

public class PreProcessorMacOS : IPreprocessBuildWithReport {
    public int callbackOrder => throw new System.NotImplementedException();

    public void OnPreprocessBuild(BuildReport report) {
        EditorUserBuildSettings.SetPlatformSettings(
            "OSXUniversal",
            "Architecture",
            "x64ARM64" );
    }
}