Created
May 15, 2013 05:42
-
-
Save davidxia/5581861 to your computer and use it in GitHub Desktop.
build xcode project without opening the damned thing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Build and iPhone Simulator Helper Script | |
# David Xia 2013 | |
# | |
# WARN: - if your .xcodeproj name is not the same as your .app name, | |
# this won't work without modifications | |
# - you must run this script in where your .xcodeproj file is | |
WORKSPACE=$1 | |
SCHEME=$2 | |
SDK=$3 | |
ARCH=$4 | |
CONFIGURATION=$5 | |
LOGFILE=$6 | |
function help | |
{ | |
echo "Usage: $0 <workspace> <scheme> <sdk> <arch> <app_path> [configuration] [logname]" | |
echo "<workspace> TBA" | |
echo "<scheme> TBA" | |
echo "<sdk> TBA" | |
echo "<arch> TBA" | |
echo "<app_path> TBA" | |
echo "[configuration] (optional) Debug or Release, defaults to Debug" | |
echo "[logname] (optional) the log file to write to. defaults to stderror.log" | |
} | |
# check first argument | |
if [ -z "${WORKSPACE}" ] || [ -z "${SCHEME}" ] || [ -z "${SDK}" ] || [ -z "${ARCH}" ]; then | |
help | |
exit 1 | |
fi | |
# default to "Debug" | |
if [ -z "${CONFIGURATION}" ] ; then | |
CONFIGURATION=Debug | |
fi | |
# default to "stderror.log" | |
# if [ -z "${LOGFILE}" ] ; then | |
# LOGFILE=stderr.log | |
# fi | |
# backup existing logfile (start fresh each time) | |
# if [ -f ${LOGFILE} ]; then | |
# mv ${LOGFILE} ${LOGFILE}.bak | |
# fi | |
xcodebuild -workspace ${WORKSPACE} -scheme ${SCHEME} -sdk ${SDK} -arch ${ARCH} | |
# ios-sim launch ${APP_PATH} --stderr ${LOGFILE} --exit | |
# osascript -e "tell application \"iPhone Simulator\" to activate" | |
# tail -f ${LOGFILE} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
then