





















@@ -5,6 +5,12 @@ require "json"
55default_platform(:ios)
6677BETA_APP_IDENTIFIER = "ai.openclawfoundation.app"
8+DEFAULT_SNAPSHOT_DEVICES = ["iPhone 16 Pro Max", "iPad Pro 13-inch (M4)"].freeze
9+SNAPSHOT_STATUS_BAR_ARGUMENTS = "--time 09:41 --dataNetwork wifi --wifiMode active --wifiBars 3 --cellularMode active --cellularBars 4 --batteryState charged --batteryLevel 100".freeze
10+REQUIRED_SCREENSHOT_FAMILIES = {
11+"iPhone" => /iPhone/,
12+"13-inch iPad" => /iPad (Air|Pro) 13-inch/
13+}.freeze
814915def load_env_file(path)
1016return unless File.exist?(path)
@@ -37,6 +43,22 @@ def screenshot_paths
3743Dir[File.join(__dir__, "screenshots", "**", "*.png")]
3844end
394546+def validate_required_screenshots!(paths)
47+missing_families = REQUIRED_SCREENSHOT_FAMILIES.filter_map do |name, pattern|
48+name unless paths.any? { |path| File.basename(path).match?(pattern) }
49+end
50+return if missing_families.empty?
51+52+UI.user_error!("DELIVER_SCREENSHOTS=1 but screenshots are missing for: #{missing_families.join(', ')}.")
53+end
54+55+def snapshot_devices
56+raw = ENV["OPENCLAW_SNAPSHOT_DEVICES"].to_s.strip
57+return DEFAULT_SNAPSHOT_DEVICES if raw.empty?
58+59+raw.split(",").map(&:strip).reject(&:empty?)
60+end
61+4062def maybe_decode_hex_keychain_secret(value)
4163return value unless env_present?(value)
4264@@ -330,8 +352,12 @@ platform :ios do
330352app_identifier = nil unless env_present?(app_identifier)
331353app_id = nil unless env_present?(app_id)
332354333-if screenshot_upload_requested? && screenshot_paths.empty?
334-UI.user_error!("DELIVER_SCREENSHOTS=1 but no PNG screenshots were found under apps/ios/fastlane/screenshots.")
355+if screenshot_upload_requested?
356+paths = screenshot_paths
357+if paths.empty?
358+UI.user_error!("DELIVER_SCREENSHOTS=1 but no PNG screenshots were found under apps/ios/fastlane/screenshots.")
359+end
360+validate_required_screenshots!(paths)
335361end
336362337363deliver_options = {
@@ -357,6 +383,30 @@ platform :ios do
357383deliver(**deliver_options)
358384end
359385386+desc "Generate deterministic iOS screenshots for App Store metadata"
387+lane :screenshots do
388+sh(shell_join(["bash", File.join(repo_root, "scripts", "ios-configure-signing.sh")]))
389+sh(shell_join(["bash", File.join(repo_root, "scripts", "ios-write-version-xcconfig.sh")]))
390+sh(shell_join(["xcodegen", "generate", "--spec", File.join(ios_root, "project.yml"), "--project", ios_root]))
391+392+capture_ios_screenshots(
393+project: File.join(ios_root, "OpenClaw.xcodeproj"),
394+scheme: "OpenClawUITests",
395+configuration: "Debug",
396+devices: snapshot_devices,
397+languages: ["en-US"],
398+launch_arguments: ["--openclaw-screenshot-mode"],
399+output_directory: File.join(ios_root, "fastlane", "screenshots"),
400+clear_previous_screenshots: true,
401+reinstall_app: true,
402+concurrent_simulators: false,
403+override_status_bar: true,
404+override_status_bar_arguments: SNAPSHOT_STATUS_BAR_ARGUMENTS,
405+skip_open_summary: true,
406+xcargs: "-allowProvisioningUpdates"
407+)
408+end
409+360410desc "Validate App Store Connect API auth"
361411lane :auth_check do
362412asc_api_key
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。