run ‘sudo xcodebuild -license’ and then agree to the terms.