9

I updated my Xcode to 14.1. but when I want to add a language in Setting, it stays on this page and I can't do any thing.

All I can do is Erase All content and Setting to return to normal state. It works on my MacBook Air M1, but no on my MacBook Pro 2019 Intel i7

enter image description here

Timmy
  • 4,098
  • 2
  • 14
  • 34
Sajjad
  • 1,536
  • 2
  • 17
  • 31
  • Same problem on the same macbook (( – ihar Nov 03 '22 at 11:00
  • 3
    I hit the same issue. Changing region or language caused the home screen app in simulator hung (activity monitor app on macOS shows that SpringBoard process took a high percentage of CPU time). Mine is MacBook Pro 2017, though that probably doesn't matter. it seems a common issue of XCode 14.1. I have filed FB11762782. – rayx Nov 07 '22 at 12:03
  • Have you found a fix? This problem is annoying. – Meeshoo Nov 29 '22 at 10:45
  • Is this problem still exist in Xcode 14.2? – Sajjad Dec 13 '22 at 20:46

1 Answers1

7

It works on M1/M2 but it doesn't on Intel. You can use the command line tool simctl as a workaround. To set the preferred language to e.g. "German" use the following command:

xcrun simctl spawn <UUID> defaults write "Apple Global Domain" AppleLanguages -array de

To change the region use:

xcrun simctl spawn <UUID> defaults write "Apple Global Domain" AppleLocale -string 'de_DE'

Replace <UUID> with the UUID of the device you want to change. To get the currently booted device(s) use:

xcrun simctl list 'devices' 'booted'

After you have changed language and/or region you need to shutdown and reboot the device like this.

xcrun simctl shutdown <UUID> followed by xcrun simctl boot <UUID>

If you only want to change the currently booted device(s) you can just use 'booted' instead of the UUID. Like so:

xcrun simctl shutdown 'booted'

So, to change the preferred language of the currently booted device(s) to English, just use:

xcrun simctl spawn 'booted' defaults write "Apple Global Domain" AppleLanguages -array en

To change language and/or region the desired device(s) must be booted.

Joachim Deelen
  • 1,021
  • 10
  • 8
  • Awesome, thank you. setting the preferred language went smoothly, but for the region I had to resort to the plutil command, which can also be used to set the language (credits: https://nshipster.com/simctl/): PLIST=~/Library/Developer/CoreSimulator/Devices/$UDID/data/Library/Preferences/.GlobalPreferences.plist LANGUAGE="ja" LOCALE="ja_JP" plutil -replace AppleLocale -string $LOCALE $PLIST plutil -replace AppleLanguages -json "[ \"$LANGUAGE\" ]" $PLIST – l3bel Dec 13 '22 at 17:30
  • do you checked it with Xcode 14.2? still exist? – Sajjad Dec 13 '22 at 20:48
  • @Sajjad I just checked with Xcode 14.2 and it worked by using the Settings App of the Simulator - at least it worked for me! – Joachim Deelen Dec 13 '22 at 22:30