How to set iOS Simulator Language when launching via simctl
Asked Answered
Z

1

5

I am launching my app in the simulator using xcrun simctl. I would like to be able to set the language that the simulator launches with (ie. switch to French on one run, to Englash on another). Is there an option to do that? It used to be possible to use -AppleLanguages option to the Simulator, but that no longer appears to work (since Xcode 5.x).

Zante answered 9/1, 2015 at 7:20 Comment(0)
K
8

Just figured this out myself:

xcrun simctl launch <deviceid> <appid> -AppleLanguages "(en-GB)"

or

xcrun simctl launch <deviceid> <appid> -AppleLanguages \(en-GB\)

When you use the -AppleLanguages as a launch argument in the scheme, it expects the parentheses around the language identifier. On the command line, bash wants to interpret them, so you either need to escape them or put the language in quotes.

Just replace en-GB with the language you want to use.

As a bootnote, when you run [NSLocale preferredLanguages] it will report the specified language.

Koehn answered 13/3, 2015 at 2:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.