Worked for me perfectly with “sudo xcode-select -s /Applications/Xcode.app/Contents/Developer” in Terminal… with Mac 10.15 Catalina, Xcode 11.3.1, and Engine Version 4.27.2
For anyone who has trouble installing Xcode because they are stuck to an older version of MacOS because their hardware doesn’t support the newest version there are two solutions:
If you have ever gotten Xcode from the Mac App Store before: you can still download that old version: go to you account page in the App Store and download Xcode from there. It will install the latest version that is compatible with your MacOS version.
If you have never downloaded Xcode before this won’t work for you. But you may be able to get your old hardware to run the newest version of MacOS by using Opencore Legacy Patcher (google it). I’m running Sonoma on a Mac from 2008… But: this is not for the faint of heart, and be sure to read all the warnings and check that you Mac is actually compatible.
July of 2024, on a newly formatted M3pro, it still happens. Xcode from app store, unreal 5.4.2 from launcher. Why the hell is this not fixed for years?? Whenever I don’t remember the command line texts, I bookmark this page and return to ‘copy’ the line…