How do I build the executable on Mac?

Source-built 4.8.1-release refuses to open my project (though it works fine on Windows). All I need to open the project for is packaging so I figured I would try from the command line.

I’m running this command:

/ BuildCookRun -project="/Users/nicholashughes/Documents/Unreal Projects/KingOfKalimpong/KingOfKalimpong.uproject" -noP4 -platform=Mac -clientconfig=Development -serverconfig=Development -cook -allmaps -NoCompile -stage -pak -archive -archivedirectory="/Users/nicholashughes/Desktop/kalimpong-alpha-builds/"

I get this error:

BuildCommand.Execute: ERROR: BUILD FAILED Program.Main: ERROR: AutomationTool terminated with exception: Program.Main: ERROR: Exception in AutomationScripts.Automation: Missing /Users/nicholashughes/code/piinecone/UnrealEngine/Engine/Binaries/Mac/ executable. Needs to be built first. Stacktrace: at Project.Cook (AutomationTool.ProjectParams Params) [0x00000] in :0 at BuildCookRun.DoBuildCookRun (AutomationTool.ProjectParams Params) [0x00000] in :0 at BuildCookRun.ExecuteBuild () [0x00000] in :0 at BuildCommand.Execute () [0x00000] in :0 Program.Main: ERROR: Missing /Users/nicholashughes/code/piinecone/UnrealEngine/Engine/Binaries/Mac/ executable. Needs to be built first.

I can see that there’s a UE4Editor-Mac-Debug, which fits the scheme definition. How do I generate the UE4Editor that the RunUAT command is looking for?

I need to use the source version because client builds packaged from the binary version of the editor can’t connect to dedicated servers built from the source version of the editor.

Perhaps it is better to just set the ue4exe flag to UE4Editor-Mac-Debug for that command?

In my case, the solution was to set the ue4exe flag to UE4Editor-Mac-Debug, so the RunUAT command looked like this:

./RunUAT.command -ue4exe=UE4Editor-Mac-Debug

I was able to successfully package from the command line. I’ll mark this as correct for now, although I’m still not sure if there should be a dir and executable or if the -Mac-Debug is right.