I switched my .NET MAUI (C#) test from iOS Simulator with iOS 18.6 to iOS 26.1 with Appium 2.19.0
Since then, I am not able to switch Orientation anymore. Previously, I just used the IOSWebDriver for that on an withe App.Orientation = ScreenOrientation.Landscape
But, this is not working anymore and I get the following error:
OpenQA.Selenium.UnknownErrorException: An unknown server-side error occurred while processing the command. Original error: Unable To Rotate Device
How can I change my orientation back and forth while my App is running, nowadays?
I am using Xcode 26.2 in combination with .NET MAUI 10.0.51 (.NET 10).
The .csproj of the Test uses Appium.WebDriver 8.2.0 and Selenium.WebDriver 4.43.0
On my Mac I have:
Appium 2.19.0 [email protected] [email protected]
I checked the Orientation Lock, but to be honest, what ways do I have to checke it?
I pulled from the right upper corner of the Simulator, but it actually does not show any option, just an empty screen with the carrier symbol.
On my Mac I also clicked on menu “Device” and it shows “Rotate Device Automatically” which is checked. And when I open my App in Simulator and click on the rotate Button in its menu, the Simulator as well as the App rotate. The App is rotated and displayed in Landscape as I would expect it from the test.
What can I check or set on the Xcode side?
The Exception is as follows:
`` UITests.iOS.LandscapeTests.Compare_BottomSheet
Source: LandscapeTests.cs line 45
Duration: 1 ms
Message:
OpenQA.Selenium.UnknownErrorException : An unknown server-side error occurred while processing the command. Original error: Unable To Rotate Device
I found out now, when I try to rotate the App in iOS Simulator on my Mac which was started with my Test, rotation does noch work first of all. But, when I click on “Device” > “Restart” (which restarts the Simulator) and launch my App from there, rotation works!
But, when I restart my Test from VS Test Explorer which includes deployment of the App and WebDriver obviously, rotation is not possible anymore again.
Do I have to add another options.AddAdditionalAppiumOption(…) to my options to enable rotation directly when my Test starts the Simulator?
# Simulator "Hard Reset" # Open Xcode > Open Developer Tools > Simulator (to start the right one) Open Simulator -> Device -> Erase All Content and Settings...
Restart Mac OS
Then, I executed my Test via VS Test Explorer again and also set the following Options:
Well, 1x it worked and could change the Orientation after there was a Screen Capture and Comparison of the UI with a reference Screenshot which failed, which is correct. But, after that no other test could successfully be executed as the also tried so set the Orientation which again failed.
I am not sure, if they used the same instance session of the Simulator or if it was a different one. Anyway, nothing could be done to set the Orientation.
I even switched to Xcode 26.3 and also in the end switched to Appium 3.3.0 with xcuitest 11.0.0
Did not work!
I am really desperate and don’t know what I could do to solve this.
It was mentioned that this causes a SpringBoard-Restart (Respring) and Appium (or XCUITest-Driver) perform this Respring, as these Language Capabilities and Region (en / US) are set.
In my Log there is something liek:[XCUITestDriver@ce86] About to update localization preferences…[XCUITestDriver@ce86] Will restart the following services…: com.apple.SpringBoard…
As the Simulator can’t perform such Language-Settings “live” while the Simulator instance is running as System-Services have to be changed for that, a restart is of the UI is mandatory.
Problem: with this Respring the Simulator seems to get in a state in which the communication is for the rotation is blocked.
Anyway, removing these two lines did help for the moment. Question is still if always have to bring the simulator in a state in which it can rotate successfully before I execute my tests or if this will help permanently.
I tried it by using the following AdditionalAppiumOptions which also worked. Before, I explicitly added the “German” Language as the first one in my iOS Simulator settings to make it sure it can work: