adb 命令设置android语言,emulator启动模拟器的时候设置语言

本文详细介绍了如何使用adb命令设置Android设备的语言,并提供了语言ISO配置的方法。包括在启动模拟器时预设语言,以及如何通过adb shell命令进行语言设置。同时解释了语言和地区的ISO代码规范。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

adb 命令设置android语言
$ adb shell '
setprop persist.sys.language en;
setprop persist.sys.country GB;
stop;
sleep 5;
start'
验证语言
$ adb shell 'getprop persist.sys.language'

emulator启动模拟器的时候设置语言

emulator -avd my_avd -prop persist.sys.language=en -prop persist.sys.country=GB

语言ISO

Configuration

Qualifier Values

Description

MCC and MNC

Examples:
mcc310
mcc310-mnc004
mcc208-mnc00
etc.

The mobile country code (MCC), optionally followed by mobile network code (MNC) from the SIM card in the device. For example, mcc310 is U.S. on any carrier, mcc310-mnc004 is U.S. on Verizon, and mcc208-mnc00 is France on Orange.

If the device uses a radio connection (GSM phone), the MCC and MNC values come from the SIM card.

You can also use the MCC alone (for example, to include country-specific legal resources in your application). If you need to specify based on the language only, then use the language and region qualifier instead (discussed next). If you decide to use the MCC and MNC qualifier, you should do so with care and test that it works as expected.

Also see the configuration fields mcc, and mnc, which indicate the current mobile country code and mobile network code, respectively.

Language and region

Examples:
en
fr
en-rUS
fr-rFR
fr-rCA
etc.

The language is defined by a two-letter ISO 639-1 language code, optionally followed by a two letter ISO 3166-1-alpha-2 region code (preceded by lowercase "r").

The codes are not case-sensitive; the r prefix is used to distinguish the region portion. You cannot specify a region alone.

This can change during the life of your application if the user changes his or her language in the system settings. See Handling Runtime Changes for information about how this can affect your application during runtime.

See Localization for a complete guide to localizing your application for other languages.

Also see the locale configuration field, which indicates the current locale.


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值