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.