0

I'm new in android automation and i've been working on adb commands to help me with tests on a physical device.

Is there a way to change the language of the device under test via adb?

I found the command below:

adb shell am start -n com.android.settings/.Settings -e :android:show_fragment com.android.settings.LocalePicker

Not worked. I also tried via shell with:

adb shell setprop persist.sys.language pt

But it didn't worked too.

andrepm
  • 867
  • 4
  • 13
  • 31

1 Answers1

5

I use the following to open locale settings in one of my applications:

final Intent intent = new Intent(Settings.ACTION_LOCALE_SETTINGS);
context.startActivity(intent);

The ACTION_LOCALE_SETTINGS constant is defined as follows:

public static final String ACTION_LOCALE_SETTINGS = "android.settings.LOCALE_SETTINGS";

So this should work:

adb shell am start -a android.settings.LOCALE_SETTINGS
Cory Charlton
  • 8,868
  • 4
  • 48
  • 68