Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/ios-simulator-screenshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,24 @@ jobs:

xcrun simctl uninstall "$udid" "$BUNDLE_ID" || true
xcrun simctl install "$udid" "$APP_PATH"

ensure_notification_permission() {
local permission_state
permission_state="$(xcrun simctl privacy "$udid" get notifications "$BUNDLE_ID" 2>/dev/null || true)"
if [[ "$permission_state" == *"granted"* ]]; then
return 0
fi

xcrun simctl privacy "$udid" grant notifications "$BUNDLE_ID" || true
}

# Avoid notification permission popups appearing in captured screenshots.
ensure_notification_permission
xcrun simctl launch "$udid" "$BUNDLE_ID"

# Some iOS runtimes only persist the permission after first launch.
ensure_notification_permission

sleep "$STARTUP_WAIT_SECONDS"
xcrun simctl io "$udid" screenshot "$shots_dir/00-launch.png"
printf "00,launch,00-launch.png\n" >> "$shots_dir/manifest.csv"
Expand Down