Android Adb shell命令以更改设备语言?

Android Adb shell命令以更改设备语言?,android,automated-tests,adb,appium,adb-shell,Android,Automated Tests,Adb,Appium,Adb Shell,我是android自动化的新手,我一直在研究adb命令,以帮助我在物理设备上进行测试 是否有办法通过adb更改被测设备的语言 我发现命令如下: adb shell am start -n com.android.settings/.Settings -e :android:show_fragment com.android.settings.LocalePicker 没用。我还尝试了通过shell: adb shell setprop persist.sys.language pt 但它也不

我是android自动化的新手,我一直在研究adb命令,以帮助我在物理设备上进行测试

是否有办法通过adb更改被测设备的语言

我发现命令如下:

adb shell am start -n com.android.settings/.Settings -e :android:show_fragment com.android.settings.LocalePicker
没用。我还尝试了通过shell:

adb shell setprop persist.sys.language pt

但它也不起作用。

我使用以下方法在我的一个应用程序中打开区域设置:

final Intent intent = new Intent(Settings.ACTION_LOCALE_SETTINGS);
context.startActivity(intent);
ACTION\u LOCALE\u SETTINGS
常量定义如下:

public static final String ACTION_LOCALE_SETTINGS = "android.settings.LOCALE_SETTINGS";
因此,这应该是可行的:

adb shell am start -a android.settings.LOCALE_SETTINGS

我使用以下命令在我的一个应用程序中打开区域设置:

final Intent intent = new Intent(Settings.ACTION_LOCALE_SETTINGS);
context.startActivity(intent);
ACTION\u LOCALE\u SETTINGS
常量定义如下:

public static final String ACTION_LOCALE_SETTINGS = "android.settings.LOCALE_SETTINGS";
因此,这应该是可行的:

adb shell am start -a android.settings.LOCALE_SETTINGS