CodeChimpy CodeChimpy - 3 years ago 256
Android Question

Changing the SimCountryIso in Android Emulator API 24 Nougat

Till now we are using this approach How do I change the Mobile Country Code (MCC) in the Android Emulator? to change the sim country value. Since we run our emulated devices with API 24 the Emulator stays in default us country code.

This is how we run it within 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
}
}
}

Answer Source

For me it works when I run this command as root user on AVD version 24+:

adb shell su root setprop gsm.sim.operator.iso-country at
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download