xcrun: error: unable to find utility "xctest", not a developer tool or in PATH
Assuming you already have Xcode installed:
Start Xcode, select "Preferences -> Locations". Chances are that your Command Line Tools are not set. Select the suggested Xcode-tools location and you are done.
You could check with:
which tools are set, mine showed:
After the location in the preferences was set, it showed:
(as it should)
Just a wrong path, all the stuff still can be done w/o invoking GUI:
~/% sudo xcode-select -s /Library/Developer/CommandLineTools ~/% sudo xcode-select -p /Library/Developer/CommandLineTools ~/% sudo xcode-select -s /Applications/Xcode.app/Contents/Developer ~/% sudo xcode-select -p /Applications/Xcode.app/Contents/Developer
-s command fixes
xcrun: error: unable to find utility "xctest" …
Xcode -> Preferences (or command+,)
Locations tab -> Command Line tools section: Select a tool there and you are done.