Xcode UI testing right-to-left language but UI is left-to-right

In my UI test I'm trying to set different languages. I noticed that with right-to-left languages, such as Arabic, the UI is still aligned left-to-right. When I manually run the app with the scheme's language set to Arabic, the UI is correctly aligned right-to-left. Am I missing something?

let app = XCUIApplication()
app.launchArguments += ["-AppleLanguages", "(ar)"]
app.launch()

Hi,

Have you tried using Xcode Test Plans? They provide an easy way to configure the language and region run during tests, and allow running in multiple configurations. This would be the recommended way.

-NSForceRightToLeftWritingDirection YES and -AppleTextDirection YES should be added to the launch arguments for right-to-left languages, but Test Plans and Scheme Settings do this for you. https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPInternational/TestingYourInternationalApp/TestingYourInternationalApp.html#//apple_ref/doc/uid/10000171i-CH7-SW5

Xcode UI testing right-to-left language but UI is left-to-right
 
 
Q