I don't usually just post links off to other sites, but here's one that
a) I don't want to forget and
b) the world needs to know about.
https://blog.winsmith.de/english/ios/2020/04/14/xcuitest-screenshots.html
It's been a while since I published an app to the App Store and either
a) something has changed or
b) I've forgotten what a pain it is to have to collect all the screenshots you need to include with your app submission.
And I've heard there is a service you could use, and I'm all for hiring experts to do difficult things, but why should that be necessary? Is this really that hard? No, it's really not.
But I should let you find out from Daniel Jilg. I took the script he posted and needed to make a few changes to suit my environment.
And it works great! It generated all the screenshots I need for the App Store! Thanks, Daniel!