{
  "id": 20309848,
  "title": "App Store Screenshots Without a Phone: Robolectric, a Fake Image Loader and a Headless Browser",
  "url": "https://urgent.news/2026/11/16/app-store-screenshots-without-a-phone-robolectric-a-fake-image-loader",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-16T18:33:53.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/nesimrazon/app-store-screenshots-without-a-phone-robolectric-a-fake-image-loader-and-a-headless-browser-4o0"
  },
  "original_language": "en",
  "account": "App developers who share code between iOS and Android can save time by generating screenshots for App Store Connect using an automated process. This method allows them to work on Windows laptops without needing an iPhone or expensive cloud build minutes.\n\nThe solution relies on Robolectric, a tool that runs Android code on a desktop JVM, enabling the creation of screenshot images. Roborazzi, a companion tool, saves these bitmap images as PNG files. A single \"qualifier\" sets the screen size to 1206x2622 pixels, matching the exact dimensions App Store Connect requires.\n\nTo accurately represent iPhone screens, the tests add padding for the Dynamic Island and other elements present only on the iOS device. Network images are replaced with real pictures using Coil's FakeImageLoaderEngine, which maps URLs to the appropriate images saved as test resources.\n\nThe screenshots capture live content and handle complex components like WebView pages. For WebView displays, the test renders the page HTML in headless Edge and overlays it on a Compose-drawn app bar. Any discrepancies between the Android rendering and iOS appearance are accepted, as the shared UI code remains consistent.\n\nWhile these generated screenshots provide a useful representation, they are not actual iOS screenshots. The actual behavior of the apps is verified separately on real iPhone devices through TestFlight. The final images are 1206x2622 pixels, determined by a 402dp by 874dp window at xxhdpi scaling.",
  "summary": "My iPhone apps share their screens with the Android versions, written once in Compose. App Store Connect wants screenshots at 1206x2622 pixels, and I work on a Windows laptop with no iPhone to spare for the job and a limited amount of cloud build minutes that I would rather spend on real builds. So I let unit tests draw the screens. This is how it works, what broke, and what these images honestly…",
  "key_points": [
    "Robolectric runs Android code on JVM for screenshot generation",
    "Roborazzi saves bitmap images as PNG files for App Store Connect",
    "Headless Edge renders WebView pages for accurate representation"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}