We’ve the problem that with each new Xcode model all of our simulators are re-created in with system language German and system area Germany. However we want it in a particular “growth language”. In our case that’s en_BZ. Moreover when I attempt to set the language now wirth Xcode 14 the simulator crashes and the one answer to carry it again is to erase its information.

How can I alter system language/area completely so I haven’t got to set that tediously with each new Xcode model and for each simulator gadget?

That is really potential suing the device simctl. Utilizing the next set of instructions this may be totally automated:

xcrun simctl listing -j "gadgets" | jq -r '.gadgets | map(.[])[].udid' | parallel 'xcrun simctl boot {}; xcrun simctl spawn {} defaults write "Apple World Area" AppleLanguages -array en; xcrun simctl spawn {} defaults write "Apple World Area" AppleLocale -string en_BZ; xcrun simctl shutdown {}'

Clarification

The {} is a placeholder offered by parallel and it represents the respective udid obtained within the first steps above. That is what the one instructions do, one after the other:

  • xcrun simctl listing -j "gadgets": Lists all gadgets which might be additionally out there in Xcode in JSON format.
  • jq -r '.gadgets | map(.[])[].udid': Filters the udid of every gadget from the JSON output. It makes use of the device jq which is a brilliant highly effective JSON parser. You must set up that utilizing brew set up jq.
  • parallel [...]: This launches the next set of command directions in parallel. That is tremendous helpful for the reason that first one, booting all simulators takes a whole lot of time. Doing this one after the other would take without end. Please brew set up parallel first.
    • xcrun simctl boot {}: Boots every simulator.
    • xcrun simctl spawn {} defaults write "Apple World Area" AppleLanguages -array en: Units English as one pf the popular languages.
    • xcrun simctl spawn {} defaults write "Apple World Area" AppleLocale -string en_BZ: Units English as used system language and Belize as system area.
    • xcrun simctl shutdown {}: Shutdown every simulator once more.