7

I'm trying to change my phone's (CM 12, Stock 4.2, both rooted) preferred network mode from "GSM/WCDMA" (0) to "WCDMA only" (2) and vice versa (there can be other modes too), using command-line only. Based on this answer I can make relevant changes into Settings.db using the commands:

adb shell 
su   
settings put global preferred_network_mode 2

However, I can't figure out from the logcat which or how many broadcasts do I have to send and with what extra key values. It is because of it I have to reboot my device to have the changes take effect.

Ultimately, how do I change the network mode without the reboot using command-line only?

Edit: Using aforesaid command in combination with airplane mode isn't working either.

5

2 Answers 2

3
+50

There are some couple of ifs and buts. I have not tried this, but this is just an idea that comes to my mind which is an extension of my previous answer.

Through this post, I learn that intents can be invoked through adb command prompt.

So, if the device is rooted and has Xposed framework, the above can be done.

1
  • 1
    +1 I actually came to know about this technique here when the first time I was researching for my issue, but I think I couldn't recall it back when I offered this bounty. The problem is that I couldn't make it work with Tasker since the latter is executing it but the effects are not observed. However, command-line works and those who might need it, here is the command: adb shell su -c 'am broadcast -a gravitybox.intent.action.CHANGE_NETWORK_TYPE --ez networkType 1'. But thanks for posting this answer.
    – user109933
    Commented Jul 6, 2015 at 9:26
0

You can refer to this post

KitKat:

echo "AT^SYSCONFIG=13,1,1,2\r" > /dev/smd0

Lollipop:

echo "AT+WS46=12\r" > /dev/umts_at0

You must log in to answer this question.