Problems building swift package on command line

Ran into an issue, where for some reason, on one of my Macs, XCode swift works fine, but on another, I got an error like:

$ xcrun --sdk macosx --find xctest
xcrun: error: unable to find utility “xctest”, not a developer tool or in PATH

Talking to my friend Christoph, he pointed out that I should run

$ sudo xcode-select -s /Applications/Xcode.app/