Is it possible to change the Apple Watch simulator locale? I want to test the localization of my watch app. I can change language on an iPhone simulator, but the watch simulator is always in English. I can't find any language settings:
6 Answers
Most certainly not possible neither via Watch Simulator UI nor iOS Simulator Watch app, but you can copy over values from iOS Simulator folder located in:
<simulator_dev_folder>/data/Library/Preferences/.GlobalPreferences.plist
to the same file in your Watch Simulator.
Plist keys to look for:
AppleLocale
AppleLanguages
AppleKeyboards
Run|Options|Application Language
Unfortunately it works only on Xcode 7.2, not on Xcode 7.1. There is no other known possibility.
EDIT
There is a brand new library for language and locale automate testing. It's called AutoMate
. The documentation can be found here.
I post my comment for a more readable format.
Hope that can be a "viable" work around
- Create the different localization files: English, French, Spanish, Chinese…
- localize all elements here
- then, open the English files
- copy the content of the language you want to test after the present english text (that will supersede it).
- To come back to english, delete this added foreign text.
I tested, it works.
I just get an error log, without apparent consequence
Watch Extension[3520:334638] [default] -[SPRemoteInterface _interfaceControllerClientIDForControllerID:]:2140: ComF: clientIdentifier for interfaceControllerID:DC00003 not found
But that is good enough to test localization on simulator.
Removing the extra text clears the error.
I improved this answer. https://stackoverflow.com/a/54883097/2519218
- Change directory to your simulator devices. eg. /Users/$USER_NAME/Library/Developer/CoreSimulator/Devices
- Detect your watch simulator. I used
ls -trl
command after build. eg. 046D5EDA-1808-4BE2-A16E-04DF0324B032 plutil -convert xml1 ./046D5EDA-1808-4BE2-A16E-04DF0324B032/data/Library/Preferences/.GlobalPreferences.plist -o change_global.plist
- Edit change_global.plist AppLanguages's section you want to use by vim. I wanted to use ja, so it's like
<key>AppleLanguages</key> <array> <string>ja</string> </array>
. - Put change_global.plist to ./046D5EDA-1808-4BE2-A16E-04DF0324B032/data/Library/Preferences/.GlobalPreferences.plist. like
cp change_global.plist ./046D5EDA-1808-4BE2-A16E-04DF0324B032/data/Library/Preferences/.GlobalPreferences.plist
. - Restart simulator.
Unfortunately, it doesn't seem like you can change the language in the watch simulator at this time. On the device, it's located in the iPhone Watch app under General -> Language & Region. However, on the iPhone simulator, there isn't even an option for the General section. This is all that shows up under the Watch app: