错误提示:
:-1: error: Xcode not set up properly. You may need to confirm the license agreement by running /usr/bin/xcodebuild.
出现这个问题可能需要进行如下操作:
- 步骤一:
安装Xcode,可以直接在Mac的AppStore中下载,通过AppStore下载的版本是8.x - 步骤二:
安装完成,执行如下命令:
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
- 步骤三:
在终端执行如下命令:
sudo xcodebuild -license
执行之后一直按空格
直到让你输入选项的时候输入agree
按回车,同意协议
- 步骤四:
执行如下命令:
vi Qt_install_folder/5.7/clang_64/mkspecs/features/mac/default_pre.prf
PS.Qt_install_folder
是你安装Qt
的路径,打开文件之后找到如下代码:
isEmpty($$list($$system("/usr/bin/xcrun -find xcrun 2>/dev/null"))): \
将这行修改为如下内容:
isEmpty($$list($$system("/usr/bin/xcrun -find xcodebuild 2>/dev/null"))): \
这样即可解决上面的错误提示。