Mac can't generate xcode project files

I use Macos 11.6.4, XCode13.2, Unreal Engine 4.27.2(download from epic games launcher).

Right click on the .uproject file and click on Generate XCode project, it will open the terminal but do nothing.

If I write command to run .sh to generate xcode project, it works. But it is too stupid.

I have exactly same problem!

I tried manay ways and can not solve this problem.
But finally I found that Rider for Unreal can automatically generate xcode project when you modify any code, so I choose to use Rider instead of XCode.

How does rider open the project??? no sln??

Rider can open *.uproject file on mac. Or just open the project folder in rider. It will recognize.

sh “/Users/Shared/Epic Games/UE_5.0/Engine/Build/BatchFiles/Mac/GenerateProjectFiles.sh” -project=“/Path/To/Project/TestProj/TestProj.uproject” -game

this should do it from terminal.

what if my project is on another external hard drive?

what would the code look like for that?

Just some small notes for people using this command. It works for me, but I’ve found that I need to remove the quotation marks. Maybe that’s obvious to most folks, but wasn’t to me at first.

Also, you can use a relative path for the .sh file (i.e ./path/from/current/directory/GenerateProjectFiles.sh) but I was only able to make the project path work if starting the path from /Users (i.e. /Users/myuser/TestProj/TestProj.uproject)

THANK YOU!!!

This worked for me…

sh /Users/Shared/Epic\ Games/UE_5.2/Engine/Build/BatchFiles/Mac/GenerateProjectFiles.sh -project=/Users/chilton/Documents/Unreal\ Projects/SeaPluPlus/SeaPluPlus.uproject -game

external hard drive works the same

Thank you! This tricked worked for me on UE 5.4.3, using macOS Sonoma

2024 still the same issue on UE 5.4.4 and Sonoma 14.5. Apple / Epic have to fix this. While this works, it’s a big pain in the ■■■ to do: first of all, the address to the engine gets hardcoded, so you can’t just create this file and run it on all machines. Then if you want to generalize this, you have to spend god knows how much time to generalize this and make it work on any mac machine.

In the Unreal source code (UE5.5) it is defined in file …/UnrealEngine/Engine/Source/Programs/Mac/UnrealEditorServices/Resources/Mac/Info.plist.

Maybe it doesn’t work because it is blocked by another security restriction from Apple.

Found an actual fix on my end; there’s a couple different manifestations of this problem that I’ve seen, including the ‘Generate Xcode project’ simply doing nothing at all, or sometimes running but claiming that the SDK setup isn’t correct, then exiting without generating anything. It’s caused by Xcode and toolchain updates that changed your primary Xcode and/or LLVM version to one that Unreal doesn’t know about.

Unreal has a config file at (assuming default install location for UE 5.8, adjust to yours as needed):
/Users/Shared/Epic Games/UE_5.8/Engine/Config/Apple/Apple_SDK.json

This file lists the allowed Xcode versions (under "//1": "Xcode versions:"), as well as an Xcode-to-LLVM version map ("AppleVersionToLLVMVersions"). Both of these must be set correctly and contain the version of Xcode and LLVM that are on your system, or generating project files doesn’t work (not sure why Unreal doesn’t fall back to at least trying with whatever version you do have and emitting a warning). Epic updates this file from time to time, but sometimes a macOS update comes through that causes this to be a little out of date. In my case, I had to add "26.6.0-21.1.6"to the AppleVersionToLLVMVersions list.

Another way around this is to additionally install an older, compatible version of Xcode alongside your main one that’s getting updated. IIRC you must also ‘select’ the correct Xcode / build tools via the Xcode settings menu or the xcode-select command line tool. This is sometimes what you need when using an older version of Unreal - sometimes just updating Apple_SDK.json isn’t enough because the toolchain is too different and actually causes compile errors. However, it’s not preferred IMO because often a given version of macOS won’t run Xcode versions that are much older than it at all without some hackery.