Solved with a Facepalm: Small Resolution Screenshots with Calabash

As I've mentioned on my blog before, I like to use Xamarin's UITest library (and Calabash, by extension) to help automate the generation of app screenshots. This allows me to reuse my existing UI testing code as well, making it incredibly easy to create the generation scripts.

Earlier this year I ran into an issue where the screenshots being generated for the iPhone 6 and 6 Plus were coming out at a lower resolution than expected, which meant they couldn't actually be used since Apple validates their dimensions. I subsequently opened this issue on Calabash for it. I spent a little time digging through the Calabash code and didn't find anything that stood out as being particularly problematic. In fact, the code around screenshot generation was very straightforward and by the books.

Fast forward six months (side note: crap, where did 2015 go?), and in revisiting this code for the first time since then it quickly hit me what was actually happening there. It's like the old medical diagnostic saying goes:

When you hear hoofbeats, think of horses not zebras.

What was actually happening here is that this particular app wasn't set up for proper support of the iPhone 6 and 6 Plus sizes, meaning that iOS was actually running them in a scaled mode on those devices. This wasn't the end of the world, and the app actually didn't look particularly bad in that mode, but this meant that the resolution of the app wasn't truly the full resolution of the screen. Saving a screenshot directly from the simulator would be at full resolution, however, which is what caused the initial confusion.

Facepalm City, Population: Me.

To solve this, all I needed to do was switch to using the proper launch screens to enable proper support of these devices. With that in place, screenshots captured through Calabash came out with the expected resolutions. Ultimately this was a pretty silly mistake on my part, but I wanted to share in case someone else runs into this as well.

comments powered by Disqus
Navigation