Skip to content

Instantly share code, notes, and snippets.

@fromkk
Last active August 1, 2018 11:46
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 fromkk/95b7fd046a081da5bfac913e1c7b31a8 to your computer and use it in GitHub Desktop.
Save fromkk/95b7fd046a081da5bfac913e1c7b31a8 to your computer and use it in GitHub Desktop.
#!/bin/sh
xcodeproj=./Type.xcodeproj
xcworkspace=./Type.xcworkspace
isWorkspace=true
test="-only-testing:TypeUITests"
scheme="Type"
configuration="Debug"
sdk="iphonesimulator"
devices=("iPhone SE" "iPhone 7" "iPhone 7 Plus" "iPhone X")
osList=("10.3.1" "11.4")
if $isWorkspace ; then
command="xcodebuild -workspace $xcworkspace"
else
command="xcodebuild -project $xcodeproj"
fi
rm -rf ./result
xcrun simctl shutdown
xcrun simctl erase all
open -a Simulator.app
command="$command -scheme $scheme -sdk $sdk -configuration $configuration"
$command clean
$command build-for-testing
for ((i = 0; i < ${#devices[@]}; i++)); do
device=${devices[$i]}
for os in ${osList[@]}; do
destination="platform=iOS Simulator,name=${device},OS=${os}"
result=./result/"${device}"_"${os}".bundle
echo $result
$command test-without-building -destination "$destination" $test -resultBundlePath "$result"
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment