How do I change the Mobile Country Code (MCC) in the Android Emulator?

neu242 picture neu242 · Apr 14, 2010 · Viewed 35.1k times · Source

My Android application needs to react differently to different Mobile Country Codes.

It seems like it is hardcoded to mcc310 (US). I can read this value from TelephonyManager.getSimCountryIso() or by using a resource folder like res/values-mcc123/ but how do I set this value in the emulator?

Answer

Espen Riskedal picture Espen Riskedal · May 27, 2016

To change what TelephonyManager.getSimCountryIso() returns, simply execute

adb shell setprop gsm.sim.operator.iso-country no

and it now returns no (Norway).

If you want to change what TelephonyManager.getSimOperator() returns (MCC+MNC) then execute

adb shell setprop gsm.sim.operator.numeric 24201

and you have changed MCC to 242 (Norway) and MNC to 01 (Telenor).

To see which other properties you can change then execute

adb shell getprop

This is verified to work on both AVD and Genymotion. However, this does not change these properties persistently.