Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to change preferred network type over adb android?

Tags:

android

adb

gsm

How can I change the preferred network type with ADB?

Example: set Use only GSM, use only WCDMA, use only LTE or automatic.

like image 586
Sidartha Carvalho Avatar asked Aug 14 '14 23:08

Sidartha Carvalho


People also ask

Can you find the preferred network type?

First, choose “Settings” from your “Apps.” Tap on “More” > “Mobile Networks” > “Preferred Network Type.” Here, you can choose between 4G, 3G, or 2G.


1 Answers

This is working for my devices:

adb shell sqlite3 /data/data/com.android.providers.settings/databases/settings.db "update global SET value = 1 WHERE name = 'preferred_network_mode'"
adb shell sqlite3 /data/data/com.android.providers.settings/databases/settings.db "select value FROM secure WHERE name = 'preferred_network_mode'"
adb shell settings put global airplane_mode_on 1
adb shell am broadcast -a android.intent.action.AIRPLANE_MODE --ez state true
sleep 5;
adb shell settings put global airplane_mode_on 0
adb shell am broadcast -a android.intent.action.AIRPLANE_MODE --ez state false
like image 194
pooja Avatar answered Oct 04 '22 21:10

pooja