I am trying to change the preferred network of android using ADB on Samsung S21 (Android 12) through the following commands:

adb shell settings put global preferred_network_mode 9
adb shell settings put global preferred_network_mode1 9
adb shell stop ril-daemon
adb shell start ril-daemon
adb shell settings put global airplane_mode_on 1
adb shell am broadcast -a android.intent.action.AIRPLANE_MODE --ez state true
adb shell sleep 5;
adb shell settings put global airplane_mode_on 0
adb shell am broadcast -a android.intent.action.AIRPLANE_MODE --ez state false

adb reboot

But it's not updating in the phone. The phone is still in WCDMA only mode.

  • 3
    Again, as I wrote on SO, you should provide more details why you think these commands should work on an S21. Where did you get them from?
    – Robert
    Oct 13, 2022 at 7:02
  • 1
    Have you observed the value for preferred_network_mode that is getting saved into settings_global.xml when you change your preferred network mode using Settings app? Use that, instead of the ones you are using. A value for preferred_network_mode is likely a part of internal API for your OS. It is not expected to remain same between devices or between OS versions. Also, in addition to what Robert asked, tell us the target mode you want to switch to. The Android version (and region) you are using might also be relevant here.
    – Firelord
    Oct 13, 2022 at 7:10
  • 1
    @Firelord I use these commands on a Samsung S9 (Android 10) and it works. On Samsung S21 I have the Android 12 version for Romania. When I change the preferred network mode from the Settings app, the value for preferred_network_mode is saved into settings_global.xml and the value for LTE, GSM/WCDMA is 9. I want to change the network from WCDMA to LTE, GSM/WCDMA.
    – rox
    Oct 13, 2022 at 14:28

1 Answer 1


You could try dialing *#*#4636#*#* to change it. When you dial this number, without pressing dial, should bring up a menu page titled "Testing". Then click on "Phone Information" and at the bottom there should be a dropdown box titled "Set preferred network type", select the dropdown box and select the cellular type you wish.

NOT to be used with ADB (Android Debug Bridge) as this "testing" page is an internal settings page unreachable by ADB without going through a lot of other things.

Fell free to comment and edit this post as I am relatively new.

  • How do dial without dialling ? Nothing happens for me on S9 or Note20 Oct 15, 2022 at 11:10
  • Put in the number and don't click the call button. Oct 17, 2022 at 15:57
  • I tried again, it does not work on my devices. Have you mistyped it ? Or does it require some other option to be enabled first ? Either way, please update your answer. Oct 17, 2022 at 20:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .