UE4 fails to detect Xcode11

Hello, I am new to UE4, and I have trouble to get it running on my mac.
I have Xcode11 installed with CLI and I tested It for c++, and it compiles a project and runs, so I think the Xcode compiler works fine.
When I try to create a project for C++ scripting I encounter an error:

“No compiler was found. In order to
use a C++ template, you must install
first Xcode”

I have searched on google/forums and I found only outdated old answers.
So I figured out to ask for myself. Thanks.

I found a fix for this problem:

Simply run this command:

sudo xcode-select --reset

I found it here