Skip to content

Conversation

@samglt
Copy link
Contributor

@samglt samglt commented Aug 27, 2025

This adds a UI testing target for use with fastlane's snapshot functionality, with a test that takes App Store screenshots on phone and tablet. There's also a basic script that masks and frames the images with imagemagick (this is apparently something fastlane can do as well, but it doesn't seem to support the latest devices). The script could be extended to also superimpose the screenshots on a nice background and fully automate the whole App Store image process pretty easily.

Take iOS screenshots with:

fastlane snapshot run

Take tvOS screenshots with:

fastlane snapshot run --scheme "Swiftfin tvOS Screenshots" --devices "[tv simulator name]"

And process them with process.sh

Note: when running the iOS tests after the tvOS tests that seems to cause some weird issue where it tries to load the tvOS app on the iOS simulator, and the only way I can get that to stop happening is to do some combination of cleaning the build folder, deleting the UI test runner and/or the app from the simulator, closing the simulator, and deleting the Swiftfin folder in Derived Data.

Example framed screenshots:

iPhone 16 Pro-Home iPhone 16 Pro-Playback iPad Pro 13-inch (M4)-Series iPad Pro 13-inch (M4)-Episode

@JPKribs JPKribs added documentation Improvements or additions to documentation enhancement New feature or request developer Alters the developer experience labels Aug 29, 2025
@samglt
Copy link
Contributor Author

samglt commented Sep 1, 2025

I've added a tvOS screenshot target now. I've never done any tvOS development so I don't know if there's a better way to do the stuff I've had to do to get these UI tests to work, but there you go.

To capture tvOS screenshots, run fastlane snapshot run --scheme "Swiftfin tvOS Screenshots" --devices "[simulator name]", that will save screenshots to the same folder as the iOS screenshots.

Apple TV 4K (3rd generation) (at 1080p)-Home Apple TV 4K (3rd generation) (at 1080p)-Series

@JPKribs
Copy link
Member

JPKribs commented Sep 10, 2025

These look awesome! I think this is a great solution for generating screenshots. Thank you for working on this!

@samglt
Copy link
Contributor Author

samglt commented Sep 11, 2025

Coming back to this, I reorganized it a bit and I think it's done enough to be used. For now I'm using a fair amount of hard-coded UI text to get elements instead of accessibilityIdentifier or accessibilityLabel; that's more vulnerable to small UI changes, but since these 'tests' are only going to be run occasionally I think it's ok to be more fragile in exchange for not adding a bunch of identifiers that only exist for these screenshot tests.

The better overall thing (I assume) would be to use accessibilityLabel much more, and then you get both better accessibility and more robust UI tests, but that's outside the scope of making screenshots.

@samglt samglt marked this pull request as ready for review September 11, 2025 00:59
@JPKribs JPKribs linked an issue Oct 23, 2025 that may be closed by this pull request
@JPKribs JPKribs removed documentation Improvements or additions to documentation enhancement New feature or request labels Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

developer Alters the developer experience

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automate Swiftfin App Store Screenshots

2 participants