Skip to content

Commit 669c4a8

Browse files
authored
Fix promo_screenshots folder name & Add docs for updating App Store Screenshots (#24935)
* Fix typo in promo_screenshots folder The lanes in `screenshots.rb` that create those screenshots use a directory name of `promo_screenshots` for WordPress (and `jetpack_promo_screenshots` for Jetpack), but the `upload_to_app_store` call was using `promo-screenshots` for WordPress instead (while correctly using `jetpack_promo_screenshots` for Jetpack). * Use constants for promo screenshots paths * Use named parameters for screenshot lanes So that `fastlane` would error if you make a typo in `with_screenshot` for example * Add `docs/app-store-screenshots.md` To document the whole process of updating App Store screenshots and uploading them to App Store Connect * There is automation for downloading promo screenshot copies after all! * Add HTML anchor links to sections
1 parent 7e60810 commit 669c4a8

File tree

4 files changed

+81
-14
lines changed

4 files changed

+81
-14
lines changed

docs/app-store-screenshots.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# App Store Screenshots
2+
3+
The upload of App Store screenshots is automated via `fastlane`.
4+
5+
First, you will want to generate the PNG files for the screenshots you want to update:
6+
- Typically you can use fastlane to [generate screenshots from your app's UI screens for all locales](#raw-screenshots), as well as to [post-process those raw screenshots of the UI to add some marketing design around them](#create-promo-screenshots).
7+
- Alternatively, if your designer already provided some pre-generated PNG files for you to use, you can [put them directly in the right folders for fastlane to pick them up](#designer-provided-screenshots) in the next phase.
8+
9+
Then, you will [use `update_metadata_on_app_store_connect with_screenshots:true` to upload those PNG files to App Store Connect](#upload-screenshots-to-asc).
10+
11+
## <a name="raw-screenshots">Auto-Generating the raw screenshots from the app's screens</a>
12+
13+
This step is based on UI Tests that fastlane will run to go through various screens in your app's UI then take screenshots of them, repeating the process for all the supported locales.
14+
15+
- For WordPress, this is based on the `WordPressScreenshotGeneration` Xcode scheme and UI test
16+
- For Jetpack, this is based on the `JetpackScreenshotGeneration` Xcode scheme and UI test
17+
18+
Note that for this to work, you need to keep those UI tests up-to-date with any modifications you make to the app's UI navigation and screens over time.
19+
20+
To run the automation that will generate those raw screenshots from your app's UI, run:
21+
22+
- `bundle exec fastlane screenshots` for WordPress
23+
- `bundle exec fastlane jetpack_screenshots` for Jetpack
24+
25+
## <a name="create-promo-screenshots">Post-processing raw screenshots with marketing design to get the final promo-screenshots</a>
26+
27+
This step takes the raw screenshots generated from the previous section, and apply some post-processing based on the instructions from the `fastlane/screenshots.json` (WordPress) / `fastlane/jetpack_screenshots.json` (Jetpack) config files, including
28+
- Framing the raw screenshots into an image of an iPhone frame
29+
- Adding some marketing texts from `fastlane/appstoreres/{metadata,jetpack_metadata}/<locale>/app_store_screenshot_*.{txt,html}` on the image
30+
31+
To run the automation to post-process the raw screenshots into promotional screenshots, run:
32+
33+
- `bundle exec fastlane create_promo_screenshots` for WordPress
34+
- `bundle exec fastlane create_jetpack_promo_screenshots` for Jetpack
35+
36+
Also, the marketing text added on those screenshots is localized. If you update the copies you will need to ensure they also go through translation by following this process before you can create the promo screenshots with localized copies:
37+
38+
- First, update the `fastlane/appstoreres/{metadata,jetpack_metadata}/source/promo_screenshot_*.txt` files with new English copies
39+
- During the release process, those new copies will be imported into GlotPress (see `update_appstore_strings` lane)
40+
- Once those copies have been translated in GlotPress, run `bundle exec fastlane download_promo_strings` (WordPress) / `bundle exec fastlane download_jetpack_promo_strings` to update the `fastlane/appstoreres/{metadata,jetpack_metadata}/<locale>/*.{txt,html}` files with those translated copies
41+
42+
43+
## <a name="designer-provided-screenshots">Use screenshots provided by your designer</a>
44+
45+
Instead of going through the 2 sections above to generate the screenshots from the app's current UI for all locales, maybe you instead already have pre-designed PNG files provided by your designer that you'll just want to use as-is.
46+
47+
In that case, you just need to put those files in the approprate folders for the fastlane automation from the next section to find them and upload them to App Store Connect.
48+
49+
- WordPress final promotional screenshots should be placed in `fastlane/promo_screenshots/<locale>/*.png`
50+
- Jetpack final promotional screenshots should be placed in `fastlane/jetpack_promo_screenshots/<locale>/*.png`
51+
52+
Fastlane will auto-detect the device type each screenshot is for based on the image resolution. Screenshots will be uploaded in alphabetical order (which means you can use e.g. numbers in file names to enforce the order the screenshots will appear in the App Store)
53+
54+
[Your `fastlane/promot_screenshots/` folder should thus look something like this](https://docs.fastlane.tools/img/actions/deliver_screenshots.png)
55+
56+
<em>If you don't want to provide dedicated localized screenshots for some locales (and make the App Store fall back to the English ones instead), be sure to delete any potential old `<locale>/*.png` files that might be present in your filesystem from a past iteration, to avoid fastlane to pick up those old files.</em>
57+
58+
## <a name="upload-screenshots-to-asc">Uploading new promo screenshots to the App Store</a>
59+
60+
Once all the final screenshot PNG files have been put in the right `fastlane/{jetpack_,}promo_screenshots/<locale>/*.png` location:
61+
62+
- Run `update_metadata_on_app_store_connect with_screenshots:true` to upload the screenshots for both WordPress and Jetpack
63+
- Or run just `update_wordpress_metadata_on_app_store_connect with_screenshots:true` to only upload them for the WordPress app
64+
- Or run just `update_jetpack_metadata_on_app_store_connect with_screenshots:true` to only upload them for the WordPress app
65+
66+
> [!NOTE]
67+
> Those lanes not only uploads the screenshots to ASC, but also the other textual metadata (app title, subtitle, etc…) for those apps.

fastlane/Fastfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ DERIVED_DATA_PATH = File.join(PROJECT_ROOT_FOLDER, 'DerivedData')
1818
BUILD_PRODUCTS_PATH = File.join(PROJECT_ROOT_FOLDER, 'Artifacts')
1919
WORDPRESS_RELEASE_NOTES_PATH = File.join(PROJECT_ROOT_FOLDER, 'WordPress', 'Resources', 'release_notes.txt')
2020
JETPACK_RELEASE_NOTES_PATH = File.join(PROJECT_ROOT_FOLDER, 'WordPress', 'Jetpack', 'Resources', 'release_notes.txt')
21+
WORDPRESS_PROMO_SCREENSHOTS_PATH = File.join(PROJECT_ROOT_FOLDER, 'fastlane', 'promo_screenshots')
22+
JETPACK_PROMO_SCREENSHOTS_PATH = File.join(PROJECT_ROOT_FOLDER, 'fastlane', 'jetpack_promo_screenshots')
2123
WORDPRESS_BETA_APP_DESCRIPTION_PATH = File.join(PROJECT_ROOT_FOLDER, 'WordPress', 'Resources', 'beta_app_description.txt')
2224
JETPACK_BETA_APP_DESCRIPTION_PATH = File.join(PROJECT_ROOT_FOLDER, 'WordPress', 'Jetpack', 'Resources', 'beta_app_description.txt')
2325
BETA_APP_DESCRIPTION_PATH_READER = File.join(PROJECT_ROOT_FOLDER, 'fastlane', 'reader_metadata', 'default', 'beta_app_description.txt')

fastlane/lanes/localization.rb

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -454,27 +454,26 @@ def download_localized_app_store_metadata(glotpress_project_url:, locales:, meta
454454
# @option [Boolean] with_screenshots (default: false) If true, will also upload the latest screenshot files to ASC
455455
#
456456
desc 'Updates the App Store Connect localized metadata'
457-
lane :update_metadata_on_app_store_connect do |options|
458-
update_wordpress_metadata_on_app_store_connect(options)
459-
update_jetpack_metadata_on_app_store_connect(options)
457+
lane :update_metadata_on_app_store_connect do |with_screenshots: false|
458+
update_wordpress_metadata_on_app_store_connect(with_screenshots: with_screenshots)
459+
update_jetpack_metadata_on_app_store_connect(with_screenshots: with_screenshots)
460460
end
461461

462462
# Uploads the localized metadata for WordPress (from `fastlane/metadata/`) to App Store Connect
463463
#
464464
# @option [Boolean] with_screenshots (default: false) If true, will also upload the latest screenshot files to ASC
465465
#
466466
desc 'Uploads the WordPress metadata to App Store Connect, localized, and optionally including screenshots.'
467-
lane :update_wordpress_metadata_on_app_store_connect do |options|
467+
lane :update_wordpress_metadata_on_app_store_connect do |with_screenshots: false|
468468
# Skip screenshots by default. The naming is "with" to make it clear that
469469
# callers need to opt-in to adding screenshots. The naming of the deliver
470470
# parameter, on the other hand, uses the skip verb.
471-
with_screenshots = options.fetch(:with_screenshots, false)
472471
skip_screenshots = with_screenshots == false
473472

474473
upload_to_app_store(
475474
**UPLOAD_TO_APP_STORE_COMMON_PARAMS,
476475
app_identifier: WORDPRESS_BUNDLE_IDENTIFIER,
477-
screenshots_path: File.join(PROJECT_ROOT_FOLDER, 'fastlane', 'promo-screenshots'),
476+
screenshots_path: WORDPRESS_PROMO_SCREENSHOTS_PATH,
478477
skip_screenshots: skip_screenshots
479478
)
480479
end
@@ -484,18 +483,17 @@ def download_localized_app_store_metadata(glotpress_project_url:, locales:, meta
484483
# @option [Boolean] with_screenshots (default: false) If true, will also upload the latest screenshot files to ASC
485484
#
486485
desc 'Uploads the Jetpack metadata to App Store Connect, localized, and optionally including screenshots.'
487-
lane :update_jetpack_metadata_on_app_store_connect do |options|
486+
lane :update_jetpack_metadata_on_app_store_connect do |with_screenshots: false|
488487
# Skip screenshots by default. The naming is "with" to make it clear that
489488
# callers need to opt-in to adding screenshots. The naming of the deliver
490489
# parameter, on the other hand, uses the skip verb.
491-
with_screenshots = options.fetch(:with_screenshots, false)
492490
skip_screenshots = with_screenshots == false
493491

494492
upload_to_app_store(
495493
**UPLOAD_TO_APP_STORE_COMMON_PARAMS,
496494
app_identifier: JETPACK_BUNDLE_IDENTIFIER,
497495
metadata_path: File.join(PROJECT_ROOT_FOLDER, 'fastlane', 'jetpack_metadata'),
498-
screenshots_path: File.join(PROJECT_ROOT_FOLDER, 'fastlane', 'jetpack_promo_screenshots'),
496+
screenshots_path: JETPACK_PROMO_SCREENSHOTS_PATH,
499497
skip_screenshots: skip_screenshots
500498
)
501499
end

fastlane/lanes/screenshots.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
# That way, it uses incremental builds instead of clean builds (faster iterations), and only generates screenshots for one language
3939
# (which is usually enough to check that the design and screens being captured look correct while iterating).
4040
#
41-
desc 'Generate localised screenshots'
41+
desc 'Generate localized screenshots'
4242
lane :screenshots do |options|
4343
FileUtils.rm_rf(DERIVED_DATA_PATH) unless options[:skip_clean]
4444

@@ -101,7 +101,7 @@
101101
#
102102
# Generates both light and dark mode, for each of the Mag16 locale, and a fixed set of device sizes (2 iPhones, 2 iPads).
103103
#
104-
desc 'Generate localised Jetpack screenshots'
104+
desc 'Generate localized Jetpack screenshots'
105105
lane :jetpack_screenshots do |options|
106106
screenshots(
107107
scheme: 'JetpackScreenshotGeneration',
@@ -118,15 +118,15 @@
118118
#
119119
# - Raw screenshots are expected to be in the `screenshots/`
120120
# - Localized metadata for the screenshots are expected to be in `appstoreres/metadata`
121-
# - Generated promo screenshots will be generated in `fastlane//promo_screenshots`
121+
# - Generated promo screenshots will be generated in `fastlane/promo_screenshots`
122122
#
123123
desc 'Creates promo screenshots'
124124
lane :create_promo_screenshots do |options|
125125
# All file paths are relative to the `Fastfile`.
126126
promo_screenshots(
127127
orig_folder: 'screenshots',
128128
metadata_folder: 'appstoreres/metadata',
129-
output_folder: File.join(Dir.pwd, '/promo_screenshots'),
129+
output_folder: WORDPRESS_PROMO_SCREENSHOTS_PATH,
130130
force: options[:force]
131131
)
132132
end
@@ -146,7 +146,7 @@
146146
orig_folder: 'jetpack_screenshots',
147147
metadata_folder: 'appstoreres/jetpack_metadata',
148148
config_file: 'jetpack_screenshots.json',
149-
output_folder: File.join(Dir.pwd, '/jetpack_promo_screenshots'),
149+
output_folder: JETPACK_PROMO_SCREENSHOTS_PATH,
150150
force: options[:force]
151151
)
152152
end

0 commit comments

Comments
 (0)