When using Qt creator following error starts rising up when Xcode gets updated to version 8.0 and it’s because of a change that is not yet applied in Qt settings. In my case it happened with Qt 5.7 and Xcode 8.0 on Mac OS X El Capitan but I think it’s safe to assume similar issues will start rising up with other kits too. Here is how I fixed it.
This was the error message I was receiving:
Xcode not set up properly. You may need to confirm the license agreement by running /usr/bin/xcodebuild.
While the most reasonable answer should be running the following command in terminal, it did not help me but I’m sharing it just in case:
sudo xcodebuild -license
After executing this command, a license will be shown. Press “Q” to end it. And then type “agree” to complete. Try this first cause this might also fix the issue in different Qt versions.
But anyway, in my case the issue was fixed by updating the following file:
Change the following part in the code:
# Make sure Xcode is set up properly isEmpty($$list($$system("/usr/bin/xcrun -find xcrun 2>/dev/null"))): \ error("Xcode not set up properly. You may need to confirm the license agreement by running /usr/bin/xcodebuild.")
As you can see this is the line of code that is producing the error. Change xcrun to xcodebuild and save the file.