How to compare before and after Compose screen changes as images in a PR without Android Studio(zenn.dev)
Writing language: KoreanRead in the original language
Plain summary
- Turn Compose Previews of Android app screen code into PNG images with a single android CLI command. You do not need to launch a development tool or a device, and no build.gradle changes are required.
- The rule of creating a preview for each screen state is written in the docs, and the PR writing skill is instructed to attach before and after images as a table. Then every time an AI agent creates a PR, the screen differences get posted.
- The same code produces the same image, so only screens that changed by byte comparison go into the table. On the author's personal verification repository, capturing before and after took 16 to 21 seconds.
- It cannot replace screenshot tests. It captures only the previews written in the changed files, and the only comparison target is the image at the merge-base point, so unintended screen changes can be missed.
Found on
Zenn ↗ / Published by source
Have you run into something like this? Tell us in a line or two what you did. You do not need to know the product.