I want to change language via ADB. I try:
adb shell setprop persist.sys.language fr;setprop persist.sys.country CA;stop;sleep 5;start
but I
There is few solutions.It works for me.
adb shell am start -a android.settings.LOCALE_SETTINGS
(You could see the language menu, then choose language by appium)
download adbchangelanguage on google store
adb shell pm grant net.sanapeli.adbchangelanguage
android.permission.CHANGE_CONFIGURATION
adb shell am start -n net.sanapeli.adbchangelanguage/.AdbChangeLanguage -e language zh -e country TW
https://gist.github.com/douglasselph/b9998e69998759c6cceec1df1aa96ac5
using appium then set desired capabilities (language and locale) http://appium.io/docs/en/writing-running-appium/caps/
Try this
adb shell "su -c 'setprop persist.sys.language fr; setprop persist.sys.country CA; stop; sleep 5; start'
You need a rooted device.
You cant do that with the adb on your device. Your adb outside the device, I mean on your computer connected with usb, can change it with passing a permission before changing the language.
On your device directly, you need a rooted device.
On Emulator: When changed language manually, it stopped working and had to do wipe data of Emulator in AVD manager to make it work again.
And the script used:
adb shell "su 0 setprop persist.sys.locale ja";adb shell "su 0 setprop ctl.restart zygote"
May add ;sleep 20 in the end if some commands in script below this command depend on device to be ready.
You can change the locale/language for testing purposes without rooting the device, also on newer (4.2+) devices. You have to create an application that changes the device locale. Or, you can use a helper app, e.g. ADB Change Language.
Next, on 4.2+ devices, you have to use grant the app CHANGE_CONFIGURATION permission via adb, adb shell pm grant <package_name> android.permission.CHANGE_CONFIGURATION
.
Finally, you can use adb commands (launch activity) to switch locale.