Can I change the Apple Watch simulator language?
Asked Answered
U

6

15

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:

Apple Watch Simulator Settings Apple Watch Simulator Settings General (top) Apple Watch Simulator Settings General (bot)

Uropygium answered 5/12, 2015 at 10:5 Comment(5)
Just a note on the bounty - a solution that will run just the app in a localised mode is fine. Currently even this doesn't seem possible.Fettling
You can use github.com/PGSSoft/AutoMate - it's a library for language and location automate testingLorimer
@Lorimer except it's for iOS, not watchOS...Fettling
With Xcode 10.1 this seems to be possible from within the Watch app on a simulated iPhone / iPad. The problem is it will usually tell you that there's no connection to the Watch. I managed to set the language for a Watch a single time, but wasn't able to reproduce it since.Shipping
@Koraktor, good news, we are one step further.Uropygium
F
6

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
Fourposter answered 26/2, 2019 at 10:13 Comment(12)
In a iOS simulator you can change language in Settings > General > Language & Region > iPhone Language. The same way as you do it on a device.Uropygium
I've changed language on the iOS sim and tried to do what you proposed. I opened .GlobalPreferences.plist in watchOS sim and, unfortunately, AppleLocale and AppleLanguages keys wasn't presented there. Anyway, your idea was great.Uropygium
No worries, kelin, just copy them over from iOS plist to Watch plist ;) after relaunching the Watch simulator, your newly set values will be used.Fourposter
did you tested your solution? Because I tried it again, copying all keys to the list and the watch simulator was still in English after the relaunching.Uropygium
You might need to wait a while until the Watch sim is fully synced with the related iOS Simulator. Even after that, the values might be occasionally overwritten by the Simulator from time to time, but it seems to be quite stable for me.Fourposter
I'm not going to test your ideas anymore. No time for that.Uropygium
I've pasted you a screenshot with a proof with Watch Simulator switched to Arabic 👍 i.imgur.com/we33dCW.png – there's no official way, only this plist injection procedure.Fourposter
Which version of watchOS do you use? I was testing this on watchOS 5.1, Apple Watch 4.Uropygium
Same one. Current Xcode 10.1 simulators. You should have your Watch simulator turned off to best prevent any preferences sweeping. As it's not officially supported, one probably needs to experiment, but I got it working on first attempt.Fourposter
Can you try it with Russian?Uropygium
Sure, no problem 😉 imgur.com/4FyOvew and here's the .GlobalPreferences.plist file content: pasty.ml/401Fourposter
It worked! You just need to wait couple of minutes before launching the simulator, also I launched it using Simulator App, not Xcode. A great upvote to you!Uropygium
D
6

You cannot change the Apple Watch simulator locale, but you can change the locale of your Watch App. I use this to test localization. To change your app locale, go edit the Watch App Scheme: Run->Options->Application Language - choose the language and re-run your Apple watch app.

Denise answered 29/2, 2016 at 8:47 Comment(5)
@Uropygium did you ever get it working? Restarting Xcode doesn't seem to do the trick for me.Fettling
@Jordan, unfortunately no.Uropygium
@ken what version of Xcode were you running? Trying to figure out why it's working for some and not others.Fettling
@Jordan I'm using XCode 7.3Hinder
Running Version 11.2.1 (11B53) and it stopped working for me.. I removed all simulators and set them up again, but didn't change anything..Sporocarp
F
6

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
Fourposter answered 26/2, 2019 at 10:13 Comment(12)
In a iOS simulator you can change language in Settings > General > Language & Region > iPhone Language. The same way as you do it on a device.Uropygium
I've changed language on the iOS sim and tried to do what you proposed. I opened .GlobalPreferences.plist in watchOS sim and, unfortunately, AppleLocale and AppleLanguages keys wasn't presented there. Anyway, your idea was great.Uropygium
No worries, kelin, just copy them over from iOS plist to Watch plist ;) after relaunching the Watch simulator, your newly set values will be used.Fourposter
did you tested your solution? Because I tried it again, copying all keys to the list and the watch simulator was still in English after the relaunching.Uropygium
You might need to wait a while until the Watch sim is fully synced with the related iOS Simulator. Even after that, the values might be occasionally overwritten by the Simulator from time to time, but it seems to be quite stable for me.Fourposter
I'm not going to test your ideas anymore. No time for that.Uropygium
I've pasted you a screenshot with a proof with Watch Simulator switched to Arabic 👍 i.imgur.com/we33dCW.png – there's no official way, only this plist injection procedure.Fourposter
Which version of watchOS do you use? I was testing this on watchOS 5.1, Apple Watch 4.Uropygium
Same one. Current Xcode 10.1 simulators. You should have your Watch simulator turned off to best prevent any preferences sweeping. As it's not officially supported, one probably needs to experiment, but I got it working on first attempt.Fourposter
Can you try it with Russian?Uropygium
Sure, no problem 😉 imgur.com/4FyOvew and here's the .GlobalPreferences.plist file content: pasty.ml/401Fourposter
It worked! You just need to wait couple of minutes before launching the simulator, also I launched it using Simulator App, not Xcode. A great upvote to you!Uropygium
L
3

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.

Lorimer answered 2/8, 2016 at 20:29 Comment(3)
Unfortunately I'm running Xcode 7.3 already. Unless that's what you meant instead of 7.1, it doesn't seem to be working. Restarts etc don't seem to fix the issue. Anything else I could try?Fettling
OK, to clarify - you're saying it works in 7.2 and is a regression in 7.3? Will only up vote if it actually works :-)Fettling
... that framework you posted isn't going to work. UITests are not supported on watchOS yet.Fettling
P
2

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.

Patnode answered 26/9, 2018 at 19:50 Comment(0)
C
2

I improved this answer. https://mcmap.net/q/777421/-can-i-change-the-apple-watch-simulator-language

  1. Change directory to your simulator devices. eg. /Users/$USER_NAME/Library/Developer/CoreSimulator/Devices
  2. Detect your watch simulator. I used ls -trl command after build. eg. 046D5EDA-1808-4BE2-A16E-04DF0324B032
  3. plutil -convert xml1 ./046D5EDA-1808-4BE2-A16E-04DF0324B032/data/Library/Preferences/.GlobalPreferences.plist -o change_global.plist
  4. 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>.
  5. 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 .
  6. Restart simulator.
Carilyn answered 11/8, 2019 at 2:17 Comment(0)
H
0

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:

iPhone Watch App

Homburg answered 7/12, 2015 at 2:36 Comment(2)
in the current simulator the option appeared but when you try it says that "this device is not paired with this apple watch"Bearwood
That may be a work around - Create all localization files: English, French, … - in English files, append the content of the language you want to test after english text. - To come back to english, delete this added foreign text. Et voila, turned around a critical miss of Watch simulator! I tested, it works. Just get an error log, without apparent consequence Watch Extension[3520:334638] [default] -[SPRemoteInterface _interfaceControllerClientIDForControllerID:]:2140: ComF: clientIdentifier for interfaceControllerID:DC00003 not found. Removing the extra text clears the error.Patnode

© 2022 - 2024 — McMap. All rights reserved.