Xcode was not detected on this Mac

On Mac, I didn’t have xcode installed when I installed unreal. So I had to install xcode and then uninstall and reinstall unreal. It seems that xcode needs to be installed before you install unreal.