13

When creating a new iOS simulator from Xcode and booting it up, it picks up its language from the macOS's keyboard language. Creating a simulator with an older runtime, e.g. iOS 13.2, the simulator boots up using system language, as it has done for years.

Is there a way to get the old behavior? Perhaps some plist value somewhere in new Xcode's settings?

Pahnev
  • 716
  • 5
  • 26
  • You can obtain the preferred language when launching the app: https://stackoverflow.com/questions/24591167/how-to-get-current-language-code-with-swift – Raptor Apr 27 '22 at 08:59
  • @Raptor the question is about how to set the language not how to get. And yes there's a native way to launch or test the app in specific languages. But if we can't control the simulator language, it's hard to do system wide things e.g. during UI tests. – Pahnev Apr 28 '22 at 12:41
  • You can set the language with a similar function: https://stackoverflow.com/questions/47605446/set-default-language-before-the-app-starts-for-the-first-time-in-ios-swift – Raptor Apr 29 '22 at 02:40
  • For the app, not the simulator… – Pahnev Apr 30 '22 at 05:11
  • Ever found the solution to that? – vomi Sep 14 '22 at 12:44
  • 3
    has anyone tried to raise this as a bug to Apple? – rshev Oct 03 '22 at 15:31

1 Answers1

13

I was experiencing the same behaviour, and could not pinpoint it to any reason because my system is setup with everything in English – except the keyboard layout, but that never crossed my mind as it didn't make sense, until I read your question.

Looking into the Simulator menu, I realized that the simulator is binding (by default) the keyboard layout of the host macOS system with the one in the sim, and apparently iOS can't change the keyboard layout without changing the language of the environment. So, tried unchecking the option I/O > Keyboard > Use the same Keyboard Language as macOS and lo and behold, the inconvenient behaviour stopped.

You can switch it back again when you need to input in your other language – that is a need I don't have in the simulator, so I'm leaving it permanently off.

Victor Jalencas
  • 1,216
  • 11
  • 23