Skip to content

Instantly share code, notes, and snippets.

@fromkk fromkk/uitest.sh
Last active Aug 1, 2018

Embed
What would you like to do?
#!/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
You can’t perform that action at this time.