Force app appearance in UI tests to be light or dark

In my UI test I'm trying to force the app's appearance (light or dark). When the system appearance is light, I can force the app to be dark with this code:

var app = XCUIApplication()
app.launchArguments += ["-AppleInterfaceStyle", "Dark"]
app.launch()

But replacing Dark with Light doesn't have any effect: if the system appearance is dark: the app remains dark. Is this not possible?

Force app appearance in UI tests to be light or dark
 
 
Q