mirror of
https://github.com/d4rken-org/capod.git
synced 2026-09-14 18:26:11 -04:00
2.7 KiB
2.7 KiB
Play Store Screenshot Pipeline
Overview
Localized screenshots are generated using Compose Preview Screenshot Testing (alpha), rendered offline (no device needed), and sorted into fastlane metadata directories for Play Store upload.
Pipeline
ScreenshotContent.kt (mock data + composables)
→ PlayStoreScreenshots.kt (@PreviewTest entry points)
→ PlayStoreLocales.kt (multi-preview locale annotations, auto-generated per batch)
→ generate_screenshots.sh (batched Gradle runs to avoid OOM)
→ copy_screenshots.sh (sort PNGs into fastlane locale dirs)
→ fastlane/metadata/android/{locale}/images/phoneScreenshots/
Key Files
| File | Purpose |
|---|---|
app/src/debug/java/.../screenshots/ScreenshotContent.kt |
Mock data composables for each screen (8 screens) |
app/src/screenshotTest/kotlin/.../screenshots/PlayStoreScreenshots.kt |
@PreviewTest functions that wire content to locale annotations |
app/src/screenshotTest/kotlin/.../screenshots/PlayStoreLocales.kt |
Multi-preview annotations (auto-generated by batch script) |
fastlane/generate_screenshots.sh |
Batched generation across 68 locales |
fastlane/copy_screenshots.sh |
Copies rendered PNGs into fastlane structure |
Commands
# Full run — all 68 locales, ~12 batches, ~7 minutes
./fastlane/generate_screenshots.sh
# Smoke test — 6 locales (en, de, ja, ar, zh-CN, pt-BR), single batch
./fastlane/generate_screenshots.sh --smoke
# Copy into fastlane directories (run after generate)
./fastlane/copy_screenshots.sh
# Clean copy (removes old screenshots first)
./fastlane/copy_screenshots.sh --clean
Adding a New Screenshot
- Add a composable content function in
ScreenshotContent.kt(e.g.NewScreenContent()) - Add a
@PreviewTestfunction inPlayStoreScreenshots.ktthat calls it - Add the function name → filename mapping in
copy_screenshots.shSCREEN_MAP - Update the expected count in
generate_screenshots.sh(composables per locale) - Run the full pipeline:
generate_screenshots.shthencopy_screenshots.sh
After UI Changes
When modifying a screen that appears in screenshots (check ScreenshotContent.kt), regenerate:
./fastlane/generate_screenshots.sh
./fastlane/copy_screenshots.sh --clean
Technical Notes
- Batch size defaults to 2 locales (16 renders) to avoid layoutlib memory leak (~10MB/image)
- Gradle daemon is stopped between batches to release memory
PlayStoreLocales.ktis temporarily rewritten per batch and restored via trap- Device spec: 1080x2400px @ 428 DPI (Pixel-class phone)
- Uses
com.android.compose.screenshotplugin v0.0.1-alpha13 - Output:
app/src/screenshotTestGplayDebug/reference/