# Screenshots

> Play Store screenshot pipeline — regenerate localized screenshots, copy them into fastlane metadata, and upload to Play Store. Covers the en-US-only git tracking and the post-upload working-tree restore.

- Skill: `d4rken-org/screenshots` (Agent Skill)
- Install (CLI): `npx skillmds@latest add d4rken-org/screenshots`
- Raw SKILL.md: https://api.skillmd.com/api/skills/d4rken-org/screenshots/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: DevOps & Infra
- Author: d4rken-org (https://skillmd.com/u/d4rken-org)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/d4rken-org/screenshots

---


# Play Store Screenshots

## What's tracked in git

- **en-US only (6 PNGs)** — `fastlane/metadata/android/en-US/images/phoneScreenshots/`. This is the set the README gallery links to.
- **The other 38 locales** — gitignored. Generated on demand for upload, not committed.

The `.gitignore` rule (lines following `app/src/screenshotTest*/reference/`) ignores all phone screenshots and `!`-includes only `en-US`.

`generate_screenshots.sh --smoke` renders 6 locales (`en-US`, `de-DE`, `ja-JP`, `ar`, `zh-CN`, `pt-BR`) covering LTR, RTL, and CJK. It is a rendering-iteration aid for checking layout under different scripts — it has nothing to do with what git tracks. Of its output, only the `en-US` set is committable; the other five land as ignored files.

## Why en-US only

- **Reviewable diffs** — a screenshot refresh that touches 6 PNGs is reviewable; 234 PNGs is not.
- **Repo size** — keeps binary churn out of git history.
- **Fastlane behavior** — `supply` skips locales with no local screenshot files, so unpushed locales keep whatever Play Store currently has. This is current Fastlane uploader behavior, not a Play Store guarantee.

## Full regeneration + upload (on demand)

1. **Generate** all 39 locales:
   ```bash
   ./fastlane/generate_screenshots.sh
   ```
   Batched gradle screenshot rendering (~20 batches, ~10–15 min). The script exits non-zero if the final PNG count differs from the expected 234 (39 × 6).

2. **Copy** rendered PNGs into fastlane metadata dirs:
   ```bash
   ./fastlane/copy_screenshots.sh --clean
   ```
   Output: `fastlane/metadata/android/<locale>/images/phoneScreenshots/*.png` for all 39 locales. Exits non-zero on an unknown composable name or an incomplete locale.

3. **Verify** count before upload:
   ```bash
   find fastlane/metadata/android -path "*/images/phoneScreenshots/*.png" | wc -l   # expect 234
   ```

4. **Upload** to Play Store:
   ```bash
   cd fastlane && bundle exec fastlane screenshots_only
   ```
   The lane invokes `remove_unsupported_languages.sh` first, which deletes `ckb-IR` and `ku-TR` translation dirs (and harmlessly errors on the other 14 absent dirs in its list).

   `fastlane/Appfile` is gitignored (`.gitignore` line 15) and holds the `json_key_file(...)` path to the Play service-account key, so it is absent in a fresh clone and in every git worktree. Without it `supply` falls back to Google Application Default Credentials and fails with `Google::Auth::InitializationError — Your credentials were not found.`, which points at Google auth instead of at the missing file. Copy it in from the main checkout first (run from the repo root); it stays gitignored, so it cannot be committed by accident:
   ```bash
   cp <main-checkout>/fastlane/Appfile fastlane/Appfile
   ```

5. **Restore** working tree (run this even if the upload FAILED):
   ```bash
   git clean -fdX fastlane/metadata/android      # removes only ignored files (the 38 non-en-US screenshot sets)
   git checkout -- fastlane/metadata/android/ckb-IR fastlane/metadata/android/ku-TR
   ```
   `git clean -fdX` removes only gitignored files, so tracked screenshots, translations, and listing assets are untouched. The `git checkout` restores the two translation dirs the lane deleted. That deletion happens before `supply` runs, so a failed upload leaves those tracked dirs deleted too.

## After the first en-US-only upload

Spot-check at least one **non-en-US** locale (e.g. `fr-FR`) in Play Console → Store listing → that locale, and confirm screenshots are still present. This validates the "Fastlane skips locales with no local files" assumption against current Play Store behavior. If other locales lose their screenshots, the workflow needs adjustment (e.g. always upload the full 39 set, or revert the gitignore split).

## When screenshots change

Re-render across scripts while iterating, then copy:
```bash
./fastlane/generate_screenshots.sh --smoke
./fastlane/copy_screenshots.sh --clean
```
Only the `en-US` set ends up in the commit (typically `Apps:` / `Permissions:` / `General:` depending on what UI changed); the other five renders stay ignored and can be dropped with `git clean -fdX fastlane/metadata/android`.

