In my UI test I'm trying to force the app's user interface style to be light or dark. On macOS, 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()
Sadly, this doesn't work with a iOS target, and UIScreen.main.traitCollection.userInterfaceStyle
is read-only. Is this not possible?