UE5 newbie installation query re: Xcode error message

Hi. Could I ask your help with a first-time UE5 installation problem?
I’ve installed Xcode and cannot open UE5. I get an error message saying I need to install Xcode. Which I have already installed.
I tried typing this command into terminal:
sudo xcodebuild -license
but I don’t understand why it will not install.
can anyone suggest how to get around this error?

Hey there @mikeb551! Welcome to the community! Are you getting this error?

“Can’t find Xcode install for Metal compiler. Please install Xcode and run Xcode.app to accept license or ensure active developer directory is set to current Xcode installation using xcode-select.”

Sometimes the issue itself is running Xcode once after it’s installation to accept the license.

if so, I’d take a look at this thread and it may help: