Skip to content

Instantly share code, notes, and snippets.

@shodanuk
Last active August 29, 2015 14:08
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 shodanuk/540cb5309f4a3fab7f12 to your computer and use it in GitHub Desktop.
Save shodanuk/540cb5309f4a3fab7f12 to your computer and use it in GitHub Desktop.
TiCalabash ios run script
if [ "$#" -ne 4 ]; then
echo
echo "Usage: run_ios.sh <iphone/ipad> <7.0.3/7.1/8.1> <stop_simulator/no_stop_simulator> <app_dir>"
echo
exit 1
fi
if [ $1 = "iphone" ]; then
platform=iphone
elif [ $1 = "ipad" ]; then
platform=ipad
else
echo
echo "1st parameter must be one of: iphone/ipad"
echo
exit 1
fi
if [ $2 = "7.0.3" -o $2 = "7.1" -o $2 = "8.1" ]; then
os_ver=$2
else
echo
echo "2nd parameter must be one of: 7.0.3/7.1/8.1"
echo
exit 1
fi
if [ $3 = "stop_simulator" ]; then
no_stop=0
elif [ $3 = "no_stop_simulator" ]; then
no_stop=1
else
echo
echo "3rd parameter must be one of: stop_simulator/no_stop_simulator"
echo
exit 1
fi
app=$4
cd "${app}"
ti clean
echo
echo "***** Running: ti build --platform ios --device-family $platform --build-only --log-level info"
ti build --platform ios --device-family $platform --build-only --log-level info
echo
cp cucumber.yml build/iphone/
echo
if [ $platform = "iphone" ]; then
echo "***** Running: NO_STOP=$no_stop DEVICE=iphone DEVICE_TARGET=\"iPhone 6 ($os_ver Simulator)\" ti calabash --platform=ios --log-level info"
NO_STOP=$no_stop DEVICE=iphone DEVICE_TARGET="iPhone 6 ($os_ver Simulator)" ti calabash --platform ios --log-level info
echo
elif [ $platform = "ipad" ]; then
echo "***** Running: NO_STOP=$no_stop DEVICE=ipad DEVICE_TARGET=\"iPad Air ($os_ver Simulator)\" ti calabash --platform=ios --log-level info"
NO_STOP=$no_stop DEVICE=ipad DEVICE_TARGET="iPad Air ($os_ver Simulator)" ti calabash --platform ios ---log-level info
echo
else
echo
echo "Unknown platform: $platform specified"
echo
exit 1
fi
echo
echo +--------------------------------------------+
echo + Any screenshots are in the build directory +
echo +--------------------------------------------+
echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment