Showing posts with label How to change language of android device using commandLine. Show all posts
Showing posts with label How to change language of android device using commandLine. Show all posts

Sunday, November 15, 2015

Android : How to change language of device using commandLine

How to change language of device using commandLine


Changing language in Android device on-the fly is needed when we are running or executing automation script in various languages.

To achieve language change of Android device, we have two ways:


You can watch a Youtube video OR follow the step by step procedure below





1> Using adb command 
 Below command can be run from command line , to change the language of device.
   
adb shell "setprop persist.sys.language fr; setprop persist.sys.country CA; 
setprop ctl.restart zygote"

** But this procedure is having one issue, your phone should be ROOTED to make adb command into effect.  

2> Using ADB Change Language APP installed on your device (link)

Steps: 
-
Install this APP on to your device.
-
Setup adb connection to your device (How to do - follow Link )
-
Android OS 4.2 onwards (tip: you can copy the command here and paste it to your command console):
adb shell pm grant net.sanapeli.adbchangelanguage android.permission.CHANGE_CONFIGURATION
- Language change example 1, Brazilian Portuguese:
adb shell am start -n net.sanapeli.adbchangelanguage/.AdbChangeLanguage -e language pt-rBR
- Language change example 2, Canadien French:
adb shell am start -n net.sanapeli.adbchangelanguage/.AdbChangeLanguage -e language fr -e country CA

To make your work easy , create a .bat file

@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@           Create .bat file                  @@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@

You can put the change language command in .bat file and can trigger it from your code.
Create a .bat file lets say : "changelang.bat" and paste below 3 line and save it.

cd /D 
adb shell am start -n net.sanapeli.adbchangelanguage/.AdbChangeLanguage -e language %1

exit




That's it.

Linux: How to change OS language via terminal?

  In this post , I will be talking about how to change language of Linux OS from Terminal . If you are not a frequent user of Linux and str...