Skip to content

Instantly share code, notes, and snippets.

@fedejordan
Last active April 19, 2019 08:39
Show Gist options
  • Save fedejordan/fc8013096ed6313e8c6d137ed8331100 to your computer and use it in GitHub Desktop.
Save fedejordan/fc8013096ed6313e8c6d137ed8331100 to your computer and use it in GitHub Desktop.
Blog01 - Script for run tests in different devices for an iOS project
#!/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