← Back to the workshop
Behind the scenes

Android Store Screenshot Kit

Real screenshots of real Android apps, taken the same way every time and ready for Google Play.

Three phone screens, the middle one framed and checked

About The Project

Store screenshots go out of date every time an app changes, and taking them by hand on a phone is slow and never quite the same twice. This kit turns them into a repeatable step: each app keeps a small test that sets up its own data and walks through its screens, and the kit does everything else.

It builds the app and its test, runs them on a chosen Firebase Test Lab device, follows the run to the end, downloads the screenshots, and checks them against Google Play's requirements before copying them into the app's store folder.

How it works

  1. Describe the run. A short TOML file names the app, its test, the devices to use, and the number and size of screenshots to expect.
  2. Write the app's part. Start from the template test, load fixed sample data, and list the screens to capture. Shared helpers wait for screens, tap, dismiss system dialogs, and lock the orientation.
  3. Run one device. A single command builds both APKs, submits them to Firebase Test Lab, and follows the test until it finishes.
  4. Collect and check. The screenshots are downloaded, checked for count, size, and colour format, and saved together with a record of the run.

Made with the kit

These are the Google Play tablet screenshots for Pocket Omaha, taken by the kit on a physical Pixel Tablet in Firebase Test Lab. The test loads recorded data for Apple, JPMorgan, and Nokia, so no market data was fetched and every run shows the same numbers.

The first run also turned up an Android compatibility warning about how one of the app's native libraries was aligned. After the library was updated, a second run went through without it.

Features

  • The same result every run: Each app loads its own recorded sample data instead of calling live services, so the screenshots do not drift from one run to the next.
  • Checked before use: Every PNG is checked for the expected count, dimensions, and the RGB format without transparency that Google Play asks for.
  • A record of every run: Each run gets its own folder with the untouched PNGs and a run.json file holding file hashes, the device, the Firebase Console link, and the exact configuration.
  • Ready for 16 KB devices: A separate check verifies the APK's alignment and that of every native library inside it, for Android devices with 16 KB memory pages.
  • No surprise bills: A device always has to be named, so a run never spreads across every configured, possibly paid, physical device.
  • Secrets stay out: Project IDs come from environment variables and sign-in from the Google Cloud CLI; no credentials live in the configuration.
  • Easy to adopt: The helpers depend only on AndroidX Test and UI Automator, so they fit apps with or without Jetpack Compose.

Under the hood

The command-line tool is a single Python script that needs nothing beyond Python 3.11. The shared helpers are a small Android library written in Java, so they add no Kotlin version requirement to the apps that use them and work with both AGP 8 and AGP 9. In CI, virtual devices can run on every pull request, with physical devices kept for release candidates. The kit is open source under the GPL-3.0 licence.