Last active
April 19, 2019 08:39
-
-
Save fedejordan/fc8013096ed6313e8c6d137ed8331100 to your computer and use it in GitHub Desktop.
Blog01 - Script for run tests in different devices for an iOS project
This file contains hidden or 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 | |
# Script configuration | |
devicesArray=( | |
"iPhone 8" | |
"iPhone 8 Plus" | |
"iPhone 5s" | |
"iPhone X") | |
workspace="FBSnapshotTestCaseExample" | |
scheme="FBSnapshotTestCaseExample" | |
# List devices to snapshot | |
echo "Devices to snapshot:" | |
for index in ${!devicesArray[*]} | |
do | |
printf " %s\n" "${devicesArray[$index]}" | |
done | |
# Create final command | |
finalCommand="xcodebuild test -workspace $workspace.xcworkspace -scheme $scheme" | |
for index in ${!devicesArray[*]} | |
do | |
finalCommand="$baseCommand -destination 'platform=iOS Simulator,name=${devicesArray[$index]}'" | |
done | |
# Execute command | |
eval $finalCommand |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment