-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscreenshots.sh
executable file
·62 lines (47 loc) · 2.09 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/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.
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
# xcrun simctl create "iPhone 15 Plus" "iPhone 15 Plus" "iOS17.5"
# xcrun simctl create "iPhone 8 Plus" "iPhone 8 Plus" "iOS16.4"
# xcrun simctl create "iPad Pro 13-inch (M4)" "iPad Pro 13-inch (M4)" "iOS17.5"
# xcrun simctl create "iPad Pro (12.9-inch) (2nd generation)" "iPad Pro (12.9-inch) (2nd generation)" "iOS17.5"
# xcodebuild -verbose \
# -project "CCCTube.xcodeproj" \
# -scheme "CCCTube" \
# -destination "platform=iOS Simulator,name=iPhone 8 Plus" \
# -destination "platform=iOS Simulator,name=iPhone 15 Plus" \
# -destination "platform=iOS Simulator,name=iPad Pro 13-inch (M4)" \
# -destination "platform=iOS Simulator,name=iPad Pro (12.9-inch) (2nd generation)" \
# -resultBundlePath "./Screenshots.xcresult" \
# -testPlan Screenshots \
# clean test
declare -a destinations=("platform=iOS Simulator,name=iPhone 8 Plus" "platform=iOS Simulator,name=iPhone 15 Plus" "platform=iOS Simulator,name=iPad Pro 13-inch (M4)" "platform=iOS Simulator,name=iPad Pro (12.9-inch) (2nd generation)")
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 "platform=iOS Simulator,name=iPhone 15 Plus" \
-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 "{}" \;
open ./screenshots