Skip to content

Instantly share code, notes, and snippets.

@ManWithBear
Forked from fedejordan/multi_devices_test.sh
Created April 20, 2018 15:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ManWithBear/e9a1ae9f722a4dddd6d9703f06f69cc8 to your computer and use it in GitHub Desktop.
Save ManWithBear/e9a1ae9f722a4dddd6d9703f06f69cc8 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