XCUIApplication launchArguments not working on xcode 7 beta 5

Hey,


I've updated my Xcode 7 from beta 3 to beta 5. I've got UI tests that are using launchArguments to properly set the language of the app. I'm using:

let app = XCUIApplication()
app.launchArguments = ["-AppleLanguages (en)"]
app.launch()


but it's not working.. Interesting thing is that it worked very well on xcode 7 beta 3 (which I cannot download now 😟 )

Replies

Yes, they are not working either with XCode 7.0 which was officialy released to the App Store - and that makes my life harder 😟

Try passing them as two separate arguments.


let app = XCUIApplication()
app.launchArguments.append("-AppleLanguages")
app.launchArguments.append("(en)")
app.launch()


I didn't try this particular flag, but it made all the difference for the argument I was passing.

I can confirm that @emarley solution works where app.launchArguments=[...] doesn't. Also, keep in mind that runing seperate test doesn't trigger `setUp` (Xcode 7.3) so you will need to run whole TestCase