-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscreenshots.sh
executable file
·45 lines (33 loc) · 1.25 KB
/
screenshots.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env zsh
# This script automates the process of taking screenshots for the App Store.
# It uses UI tests target, which are configured in the Screenshots test plan.
# The final screenshots are saved in a folder named 'screenshots'.
set -e
if ! command -v xcparse &> /dev/null
then
echo "xcparse could not be found. Please install it: brew install chargepoint/xcparse/xcparse"
exit 1
fi
if ! command -v convert &> /dev/null
then
echo "ImageMagick could not be found. Please install it: brew install imagemagick"
exit 1
fi
declare -a destinations=("platform=iOS Simulator,name=iPhone 16 Plus" "platform=iOS Simulator,name=iPad Pro 13-inch (M4)")
rm -rf ./screenshots
mkdir ./screenshots
for destination in "${destinations[@]}"
do
rm -rf ./Screenshots.xcresult
echo "Taking screenshots for $destination"
xcodebuild -quiet \
-project "CCCTube.xcodeproj" \
-scheme "CCCTube" \
-destination "$destination" \
-resultBundlePath "./Screenshots.xcresult" \
-testPlan Screenshots \
clean test
xcparse screenshots --os --model --test-plan-config "./Screenshots.xcresult" "./screenshots/"
done
# Remove alpha channel from the screenshots, otherwise the App Store will reject them
find ./screenshots -name "*.png" -exec convert "{}" -alpha off "{}" \;