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.
sh â/Users/Shared/Epic Games/UE_5.0/Engine/Build/BatchFiles/Mac/GenerateProjectFiles.shâ -project=â/Path/To/Project/TestProj/TestProj.uprojectâ -game
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)
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.
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.