The only way I could get this to work is to use the method in detail here
Add these two options to the xcodebuild
or scan -x
command
CLANG_ANALYZER_OUTPUT=plist-html \ CLANG_ANALYZER_OUTPUT_DIR="$(pwd)/clang"
This will create an HTML file if there are clang warnings. Therefore, check for the presence of this file.
if [[ -z `find clang -name "*.html"` ]]; then echo "Static Analyzer found no issues" else echo "Static Analyzer found some issues" exit 123 fi
source share