(iOS) - Unable To Rotate Device on Appium 1.9.0

The Problem
When our Java automation tests use the below code, appium errors with ‘Unable to Rotate device’.
This issue is only occurring on test runners upgraded to appium 1.9.0 and xcode 10. Runners using appium 1.8.1 and lower Xcode versions are not experiencing this issue.

public void rotateDevice(String orientation) {
        if (orientation.equalsIgnoreCase("landscape")) {
            **driver.rotate(ScreenOrientation.LANDSCAPE);**
        } else {
            **driver.rotate(ScreenOrientation.PORTRAIT);**
        }
        waitFor(500);
    }

Details
I’ve been unable to find any related issues logged recently- there seems to be similar errors in iOS 9 from a few years ago.

When attempting to rotate a real device screen orientation i’m receiving this error ;
Org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Unable To Rotate Device

Environment Setup:
Mac OS : High Sierra v10.13.6
Real Device: iPhone 8 iOS 11.2.2
Xcode: 10
Appium: 1.9.0
Node: v10.2.1

Snippet from Appium logs;

[BaseDriver] Waiting up to 3000 ms for condition
[JSONWP Proxy] Matched ‘/element’ to command name ‘findElement’
[JSONWP Proxy] Proxying [POST /element] to [POST http://localhost:55983/session/52CE5F93-3B11-4257-8DA4-5E0CDB60A839/element] with body: {“using”:“accessibility id”,“value”:“Back”}
[JSONWP Proxy] Got response with status 200: {“value”:{“ELEMENT”:“53000000-0000-0000-9001-000000000000”},“sessionId”:“52CE5F93-3B11-4257-8DA4-5E0CDB60A839”,“status”:0}
[W3C] Responding to client with driver.findElement() result: {“element-6066-11e4-a52e-4f735466cecf”:“53000000-0000-0000-9001-000000000000”}
[HTTP] e[37m<-- POST /wd/hub/session/c7befb51-8585-43cd-9969-bbbc495ca412/element e[39me[32m200e[39m e[90m245 ms - 88e[39m
[HTTP] e[90me[39m
[HTTP] e[37m–>e[39m e[37mGETe[39m e[37m/wd/hub/session/c7befb51-8585-43cd-9969-bbbc495ca412/element/53000000-0000-0000-9001-000000000000/locatione[39m
[HTTP] e[90m{}e[39m
[W3C] Calling AppiumDriver.getLocation() with args: [“53000000-0000-0000-9001-000000000000”,“c7befb51-8585-43cd-9969-bbbc495ca412”]
[XCUITest] Executing command ‘getLocation’
[JSONWP Proxy] Matched ‘/element/53000000-0000-0000-9001-000000000000/rect’ to command name ‘getElementRect’
[JSONWP Proxy] Proxying [GET /element/53000000-0000-0000-9001-000000000000/rect] to [GET http://localhost:55983/session/52CE5F93-3B11-4257-8DA4-5E0CDB60A839/element/53000000-0000-0000-9001-000000000000/rect] with no body
[JSONWP Proxy] Got response with status 200: “{\n “value” : {\n “y” : 20,\n “x” : 0,\n “width” : 44,\n “height” : 44\n },\n “sessionId” : “52CE5F93-3B11-4257-8DA4-5E0CDB60A839”,\n “status” : 0\n}”
[W3C] Responding to client with driver.getLocation() result: {“x”:0,“y”:20}
[HTTP] e[37m<-- GET /wd/hub/session/c7befb51-8585-43cd-9969-bbbc495ca412/element/53000000-0000-0000-9001-000000000000/location e[39me[32m200e[39m e[90m146 ms - 24e[39m
[HTTP] e[90me[39m
[HTTP] e[37m–>e[39m e[37mPOSTe[39m e[37m/wd/hub/session/c7befb51-8585-43cd-9969-bbbc495ca412/orientatione[39m
[HTTP] e[90m{“orientation”:“LANDSCAPE”}e[39m
[W3C] Driver proxy active, passing request on via HTTP proxy
[XCUITest] Executing command ‘proxyReqRes’
[JSONWP Proxy] Matched ‘/wd/hub/session/c7befb51-8585-43cd-9969-bbbc495ca412/orientation’ to command name ‘setOrientation’
[JSONWP Proxy] Proxying [POST /wd/hub/session/c7befb51-8585-43cd-9969-bbbc495ca412/orientation] to [POST http://localhost:55983/session/52CE5F93-3B11-4257-8DA4-5E0CDB60A839/orientation] with body: {“orientation”:“LANDSCAPE”}
[JSONWP Proxy] Got response with status 200: {“value”:“Unable To Rotate Device”,“sessionId”:“52CE5F93-3B11-4257-8DA4-5E0CDB60A839”,“status”:777}
[W3C] Encountered internal error running command: ProxyRequestError: Could not proxy command to remote server. Original error: The request to /wd/hub/session/c7befb51-8585-43cd-9969-bbbc495ca412/orientation has failed
[W3C] at JWProxy.proxy$ (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/jsonwp-proxy/proxy.js:194:13)
[W3C] at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
[W3C] at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
[W3C] at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
[W3C] at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[MJSONWP] Matched JSONWP error code 777 to UnknownError
[HTTP] e[37m<-- POST /wd/hub/session/c7befb51-8585-43cd-9969-bbbc495ca412/orientation e[39me[31m500e[39m e[90m1578 ms - 1255e[39m
[HTTP] e[90me[39m
[HTTP] e[37m–>e[39m e[37mGETe[39m e[37m/wd/hub/session/c7befb51-8585-43cd-9969-bbbc495ca412/screenshote[39m
[HTTP] e[90m{}e[39m
[W3C] Calling AppiumDriver.getScreenshot() with args: [“c7befb51-8585-43cd-9969-bbbc495ca412”]
[XCUITest] Executing command ‘getScreenshot’
[XCUITest] Taking screenshot with WDA
[JSONWP Proxy] Matched ‘/screenshot’ to command name ‘getScreenshot’
[JSONWP Proxy] Proxying [GET /screenshot] to [GET http://localhost:55983/session/52CE5F93-3B11-4257-8DA4-5E0CDB60A839/screenshot] with no body
[JSONWP Proxy] Got response with status 200: "{\n “value” : "iVBORw0KGgoAAAANSUhEUgAAAu4AAAU2CAIAAABFtaRRAAAAAXNSR0IArs4c6QAA\r\nABxpRE9UAAAAAgAAAAAAAAKbAAAAKAAAApsAAAKbAAQ2AA+wGGQAAEAASURBVHgB\r\n7H0HeFTV1vaZPpNOUyRlZs6c6ZMQVOxXUEEgdAgkpPfJZJJMyqR3qlRFQbBgQ0AR\r\nUFAUFRAVG1YQlY5I7yCdlPO\/++yTe3M\/xc\/c\/\/J59eZ51h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nthzG2DzETIXtMjmXB6PXYayFxCzFMAlXCpNzhTCJKQfGWNOJtfP67X2/xJwNY0x5\r\nghUzJlh5G6O/IX9tfWf7vm9774eOBmMuFCyXMcPwCLJlphxiRg8xPDKYoRwmMeW2\r\nsTwJ7tPoEaxYYqQ3j+HNI2bFkOa0+36u8/h33M+/dwToPKFzgDGWEDNREyaDsJbF\r\nT6R/5aoZmCWbGP0rV8lwlXRnIH/6u9kyGVum+Hv6TjqjrJhaeYyxHCYxVMMYYykx\r\nEzYHTNc8mPiJwhUYezox4T0SQyUxYc9hMF3/PmOFfYax5AjW5t7od6HXFz/lOq/H\r\njvn/7x0Bcc/3MBZMD7rrknnCmHG4YIpi2sDIjJVxxTCVIQ9GXzNcAzFbLjFrNjHh\r\nCjJzJjG2DsZYcKAU0plPd0j6U5yT4qeQOSPOOlsWA6PfUZiBdDul81ac7XRmCrNR\r\nPAWEPVlcWcLMF080sl3n0quRrRi3Z6whJn6usBKtWQyMzl66joyVDDFhBdF/Jawd\r\nuoLEeyMHU6vR+zQKO7ywcul3oWeo+Da6KulYYagtOBToidC+9SLhymFY+MSE+5Rz\r\nHpi40u05DEx4piptA4zuP+Kd02/dZsxbMQa5E/HKdGzpz9+eaR1QpnUq/PojbAUo\r\n…
[HTTP] e[37m<-- GET /wd/hub/session/c7befb51-8585-43cd-9969-bbbc495ca412/screenshot e[39me[32m200e[39m e[90m221 ms - 925188e[39m
[HTTP] e[90me[39m
[HTTP] e[37m–>e[39m e[37mGETe[39m e[37m/wd/hub/session/c7befb51-8585-43cd-9969-bbbc495ca412/log/typese[39m
[HTTP] e[90m{}e[39m
[W3C] Calling AppiumDriver.getLogTypes() with args: [“c7befb51-8585-43cd-9969-bbbc495ca412”]
[XCUITest] Executing command ‘getLogTypes’
[BaseDriver] Retrieving supported log types
[W3C] Responding to client with driver.getLogTypes() result: [“syslog”,“crashlog”,“performance”,“server”,“safariConsole”,“safariNetwork”]
[HTTP] e[37m<-- GET /wd/hub/session/c7befb51-8585-43cd-9969-bbbc495ca412/log/types e[39me[32m200e[39m e[90m2 ms - 86e[39m
[HTTP] e[90me[39m
[HTTP] e[37m–>e[39m e[37mPOSTe[39m e[37m/wd/hub/session/c7befb51-8585-43cd-9969-bbbc495ca412/loge[39m
[HTTP] e[90m{“type”:“syslog”}e[39m
[W3C] Calling AppiumDriver.getLog() with args: [“syslog”,“c7befb51-8585-43cd-9969-bbbc495ca412”]
[XCUITest] Executing command ‘getLog’
[BaseDriver] Retrieving ‘syslog’ logs
[BaseDriver] Retrieving supported log types
[W3C] Responding to client with driver.getLog() result: []
[HTTP] e[37m<-- POST /wd/hub/session/c7befb51-8585-43cd-9969-bbbc495ca412/log e[39me[32m200e[39m e[90m2 ms - 12e[39m
[HTTP] e[90me[39m
[HTTP] e[37m–>e[39m e[37mPOSTe[39m e[37m/wd/hub/session/c7befb51-8585-43cd-9969-bbbc495ca412/loge[39m
[HTTP] e[90m{“type”:“crashlog”}e[39m
[W3C] Calling AppiumDriver.getLog() with args: [“crashlog”,“c7befb51-8585-43cd-9969-bbbc495ca412”]
[XCUITest] Executing command ‘getLog’
[BaseDriver] Retrieving ‘crashlog’ logs
[BaseDriver] Retrieving supported log types
[XCUITest] Cannot get the name of the crashes folder for the device with udid ‘89630f98a48c7f9e25abe0db49e89b230be9f298’. Original error: Command ‘idevicename -u 89630f98a48c7f9e25abe0db49e89b230be9f298’ exited with code 255
[W3C] Responding to client with driver.getLog() result: []
[HTTP] e[37m<-- POST /wd/hub/session/c7befb51-8585-43cd-9969-bbbc495ca412/log e[39me[32m200e[39m e[90m63 ms - 12e[39m
[HTTP] e[90me[39m
[HTTP] e[37m–>e[39m e[37mPOSTe[39m e[37m/wd/hub/session/c7befb51-8585-43cd-9969-bbbc495ca412/loge[39m
[HTTP] e[90m{“type”:“server”}e[39m
[W3C] Calling AppiumDriver.getLog() with args: [“server”,“c7befb51-8585-43cd-9969-bbbc495ca412”]
[XCUITest] Executing command ‘getLog’
[BaseDriver] Retrieving ‘server’ logs
[BaseDriver] Retrieving supported log types