How to Specify Screenshot Orientation for iOS Devices

April 02, 2026 · 6 min read · Mobile Testing

HeadSpin Platform
Automated & amp; manual examination made easy through data science insights.
Differentiating capabilities:
  • Extended end-to-end automation of QA process
  • Relative analysis of app performance against peers
  • Uninterrupted monitoring of app performance habituate synthetic data for higher availability of apps
  • Easy-to-use developer friendly platform
cloudtest go
Affordable Real Device Testing for Emerging Teams
cloudtest go
Low-cost Existent Device Testing for Digital Enterprises
cloudtest go
The Ultimate Solution for a Powerful Blend of Functional & amp; Performance Testing!
cyol
TEM
New
Centralized mobile examination performance in cloud
cyol
Enhance Your Accessibility Testing With HeadSpin
cyol
Automate camera-based testing

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

retail

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

Specifying Screenshot Orientation for iOS DevicesSpecifying Screenshot Orientation for iOS Devices

How to Specify Screenshot Orientation for iOS Devices

Published on
April 15, 2020
Updated on
Published on
February 7, 2022
Updated on
 by 
 Jonathan LippsJonathan Lipps
Jonathan Lipps

If you do a lot of using Appium and have demand peculiarly for user flows that involve rotating the gimmick to a different blind orientation, you might have noticed that screenshots retrieved by Appium in these cases might be incorrectly rotated. That is, the screenshot might not check the visible orientation of the device. This can be especially troublesome if you are using image-based examination, because Appium habituate the co-ordinate from the screenshot to enable you to interact with found image regions!

See:

Unfortunately, some of the time the screenshot comes back rotated wrongly, Appium is not at fault; in these cases, XCUITest is just doing its thing, and Appium doesn & # x27; t know whether the image is correct or not (it & # x27; s not peek at the & quot; contents & quot; of the screenshot to check that it & # x27; s correct). But if you observe yourself in this situation as a test writer,youcognize what the screenshot is supposed to look like,youcognise which orientation your device is in, and you can tell Appium which orientation you want it to use for screenshots!

For autonomous testing across multiple user personas, check out SUSATest — it explores your app like 10 different real users.

Also see:

The screenshotOrientation fix

To accomplish this we make use of Appium & # x27; s Settings API, and specifically a setting (unloose in Appium 1.17) callscreenshotOrientation.There are 5 possible values this setting can take:

  • auto: don & # x27; t enforce any screenshot orientation. Just walk along the screenshot given byXCUITest.
  • portrait:enforce portrait orientation for the screenshot.
  • portraitUpsideDown:enforce the & quot; upside-down & quot; orientation for the screenshot.
  • landscapeRight:enforce a landscape (turn to the right) orientation.
  • landscapeLeft:enforce a landscape (turned to the left) orientation.

The way we tell Appium to use a peculiar value is (in Java) with thedriver.setSetting command:

driver.setSetting (`` screenshotOrientation '', `` landscapeRight '')

Calling this will set the screenshot orientation value for the duration of the Appium session (or until I choose to call setSetting again with a different value).

Check out:

Usage example

I was able to see this setting in action by pen a test that first turns a device to landscape mode, and then attempts to occupy a screenshot. If, before I start the test, I revolve the device manually, but in the paired direction to the one Appium would normally rotate it (i.e., if I revolve it left), then I noticed that Appium & # x27; s screenshots came back upside down!

Also cheque:

Anyway, in this case, include the setting of thescreenshotOrientationvalue enable me to guarantee the screenshot would always come back in the correct orientation. Check out the full example below (and as always, the code is upon GitHub too:

public class Edition112_iOS_Screenshot_Orientation {private IOSDriverdriver; individual final atmospherics String PHOTOS = `` com.apple.mobileslideshow ''; @ Before public void apparatus () throws MalformedURLException {DesiredCapabilities capabilities = new DesiredCapabilities (); capabilities.setCapability (`` platformName '', `` iOS ''); capabilities.setCapability (`` platformVersion '', `` 13.3 ''); capabilities.setCapability (`` deviceName '', `` iPad Pro (12.9-inch) (3rd generation) ''); capabilities.setCapability (`` app '', PHOTOS); capabilities.setCapability (`` simulatorTracePointer '', true); driver = new IOSDriver(new URL (`` http: //localhost:4723/wd/hub ''), capabilities);} @ After public nihility tearDown () {if (driver! = null) {driver.quit ();}} @ Test public void testScreenshots () throws Exception {Thread.sleep (2000); String desktop = System.getenv (`` HOME '') + `` /Desktop ''; driver.rotate (ScreenOrientation.LANDSCAPE); // this screenshot might be correct or it might be upside down File regularScreenshot = driver.getScreenshotAs (OutputType.FILE); // this screenshot should constantly be right driver.setSetting (`` screenshotOrientation '', `` landscapeRight ''); File adjustedScreenshot = driver.getScreenshotAs (OutputType.FILE); FileUtils.copyFile (regularScreenshot, new File (desktop + `` /screen1.png '')); FileUtils.copyFile (adjustedScreenshot, new File (desktop + `` /screen2.png ''));}}
Author & # x27; s Profile

Jonathan Lipps

LinkedIn
Author & # x27; s Profile

Piali Mazumdar

Lead, Content Marketing, HeadSpin Inc.

Piali is a active and results-driven Content Marketing Specialist with 8+ geezerhood of experience in craft engaging narratives and market collateral across divers industry. She excels in collaborating with cross-functional teams to develop innovative substance strategies and deliver compelling, authentic, and impactful message that resonates with target audiences and enhances brand legitimacy.

LinkedIn

How to Specify Screenshot Orientation for iOS Devices

4 Parts

regression intelligence blog
-

Regression Intelligence practical usher for advanced users (Part 3)

Coming Soon
Regression Intelligence practical guide for advanced users
-

Regression Intelligence hard-nosed guide for advanced users (Part 4)

Coming Soon

Discover how HeadSpin can empower your business with superior try capabilities

Our Platform enables you to:
accelerate time-to-market
Accelerate time-to-market, gaining a competitive edge
faster development cycles
Boost developer/QA productivity with faster ontogenesis rhythm
automated buil-over-build regression testing
Automate build-over-build regression testing for consistent answer
gain better visibility into functional & performance issues
Gain better visibility into functional and performance issues
reduce mean time
Reduce mean time to identify/resolve during test, QA, and production
evaluate audio, video & qoe
Evaluate sound, video, and content quality of experience (QoE) effortlessly
The trusted choice for worldwide enterprises
Adobe
Hargreaves Lansdown
Truecaller
Crazylabs
Nedbank
Numeracle
Veryon
Close

Discover how HeadSpin can empower your occupation with superior try capabilities

Our Platform enable you to:
accelerate time-to-market
Accelerate time-to-market, acquire a militant edge
faster development cycles
Boost developer/QA productivity with quicker development cycles
automated buil-over-build regression testing
Automate build-over-build regression testing for consistent results
gain better visibility into functional & performance issues
Gain best visibility into functional and performance issues
reduce mean time
Reduce mean time to identify/resolve during test, QA, and production
evaluate audio, video & qoe
Evaluate sound, video, and content quality of experience (QoE) effortlessly
The trusted choice for global enterprise
Close

Discover how HeadSpin can empower your concern with superior testing capableness

Our Platform enables you to:
accelerate time-to-market
Accelerate time-to-market, gaining a competitive edge
faster development cycles
Boost developer/QA productivity with faster development cycle
automated buil-over-build regression testing
Automate build-over-build fixation testing for consistent results
gain better visibility into functional & performance issues
Gain best visibleness into functional and performance issues
reduce mean time
Reduce mean clip to identify/resolve during examination, QA, and production
evaluate audio, video & qoe
Evaluate sound, video, and content quality of experience (QoE) effortlessly
The trusted choice for global enterprises
Close

Connet Now

Wipro LogoVMLYR Logo
Close
Book a Meeting
Products
footer down arrow
Solutions
footer down arrow
Industries
footer down arrow
Features
footer down arrow
Support
footer down arrow
Resource Center
footer down arrow
Why Choose HeadSpin?
footer down arrow
Copyright © 2026 HeadSpin, Inc. All Rights Reserved.

Automate This With SUSA

Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts needed.

Try SUSA Free

Test Your App Autonomously

Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts.

Try SUSA Free