Screen Rotation in Appium 1.6 Missing?

I can’t seem to rotate the screen, I get an error “Unable to Rotate”

I have tried setting capabilities

capabilities.setCapability(MobileCapabilityType.ROTATABLE, true);

driver.rotate(ScreenOrientation.LANDSCAPE);

and using augment as well.

Are you test against iOS using XCUITEST? If so, device rotation is not supported(see the link below), however you can still set the initial device orientation.

https://github.com/appium/appium/blob/master/docs/en/advanced-concepts/migrating-to-xcuitest.md