在安卓模拟器API 24 Nougat中更改SimCountryIso

3
到目前为止,我们使用如何在Android模拟器中更改移动国家代码(MCC)?这种方法来更改sim卡的国家值。由于我们使用API 24运行模拟设备,模拟器会保持默认的美国国家代码。

以下是我们在gradle中运行的方式:

tasks.withType(Test) {
    systemProperties = System.getProperties()
    systemProperty "buildDir", "${buildDir}"
    systemProperty "file.encoding", "UTF8"

    beforeTest {
        logger.info "restoring android emulator SIM country to AT"
        exec {
            commandLine "bash", "-c", "source ~/.bash_profile && adb -e shell setprop gsm.sim.operator.iso-country at
            ignoreExitValue true
        }
    }
}
1个回答

8

对于我来说,在AVD版本24+上,当我以root用户身份运行此命令时,它可以正常工作:

adb shell su root setprop gsm.sim.operator.iso-country at

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接