Building for mac via script doesnt work

I wrote a script to create builds for both mac and windows and push them to steam. It works great for windows, but for mac it creates nothing.

Here are the commands I use:

C:/Program\ Files/Unity/Hub/Editor/2021.2.16f1/Editor/Unity.exe -quit -batchmode -logFile win64UnityBuild.log -projectPath “UnityClient” -buildWindowsPlayer “C:/…/Executables/Win64/gamename.exe”

C:/Program\ Files/Unity/Hub/Editor/2021.2.16f1/Editor/Unity.exe -quit -batchmode -logFile macUnityBuild.log -projectPath “UnityClient” -buildOSX64Player “C:/…/Executables/Mac.app/gamename.app”

Its basically the same except for the build target. And also the fact that the first one works and the second one produces an empty directory.

The created windows log file has a lot of build information. The created mac log file is missing all that. It has logs that I assume are for opening unity, closing unity, and nothing that seems like its for actually building.

There are no errors or anything, it just seems like its totally ignoring the -buildOSX64Player item. (I also tried -buildOSXPlayer)

When I build via the UI it all works fine. (for both mac and windows)

So what gives? Why isn’t -buildOSX64Player doing anything?

Is it because that is not a valid build argument?
https://docs.unity3d.com/2021.2/Documentation/Manual/EditorCommandLineArguments.html
Should you perhaps be trying -buildOSXUniversalPlayer as that seems to be the only OSX player in the build arguments?

Va

Valid according to this: https://docs.unity3d.com/460/Documentation/Manual/CommandLineArguments.html

But it is noteworthy that its missing from the page you linked, I will try it with that argument instead and see if it makes a difference.

Wouldn’t that be kind of a problem still though even if it works? Aren’t universal builds far larger in size than the 64/32 bit versions?

Edit: This made no difference, it left me with an empty directory, the same as with all the other mac build arguments I tried.

I’m just going on the fact that your folder structure has version 2021 (so I linked that version of the manual), yet you are linking to v4.6 of the manual.
What version are you actually using to build?