Skip to content

Instantly share code, notes, and snippets.

@guehara
Created March 7, 2013 01:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guehara/5104833 to your computer and use it in GitHub Desktop.
Save guehara/5104833 to your computer and use it in GitHub Desktop.
xcodebuild statis analyzer
#!/bin/sh
LATEST_VER=`xcodebuild -showsdks |sed -n -e 's/^.*sdk iphonesimulator\([0-9.]\{1,\}[^\n]\)$/\1/p'|sort|sed -n '$p'`
BUILD_CONFIG="Debug"
BUILD_OPTS="clean build"
OUTPUT_DIR="reports"
ANALYZE_OPTS="RUN_CLANG_STATIC_ANALYZER=YES CLANG_ANALYZER_OUTPUT=plist-html CLANG_ANALYZER_OUTPUT_DIR=${OUTPUT_DIR}"
if [ "$1" == ""]; then
exit
fi
TARGET = $1
# 古い解析結果を削除
if [ -d $OUTPUT_DIR ]; then
rm -rf $OUTPUT_DIR
fi
xcodebuild -target $TARGET -configuration $BUILD_CONFIG -sdk iphonesimulator$LATEST_VAR $ANALYZE_OPTS $BUILD_OPTS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment