Adb Command - Marshmallow - Change Preferred LTE / GSM Network Mode

I'm on 6.0.1 Marshmallow OS, and my previous commands to change my preferred network mode no longer work.

The commands used in Kit Kat worked without problems:

adb shell sqlite3 /data/data/com.android.providers.settings/databases/settings.db "SELECT * FROM global WHERE name='preferred_network_mode'" 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' 

The commands entered in this OS lead to the conclusion:

 Error: no such table: global 

I pulled out a database file that was completely empty:

 adb pull /data/data/com.android.providers.settings/databases/ 

Is there any ADB command that I can use to change preferred_network_mode to LTE / GSM?

+2
source share
2 answers

After a lot of research, this was the working solution I found for Marshmallow .

Preferred network mode numbers found: https://android.googlesource.com/platform/hardware/ril/+/master/include/telephony/ril.h#228

1 GSM only

11 only LTE

 adb wait-for-devices adb root adb wait-for-devices adb shell settings list global | grep pref 

This returned me both "preferred_network_mode" and "preferred_network_mode1"

 adb shell settings put global preferred_network_mode 1 adb shell settings put global preferred_network_mode1 1 adb shell stop ril-daemon adb shell start ril-daemon 
+5
source

adb shell:

 content update --uri content://settings/global --bind value:i:12 --where "name='preferred_network_mode'" 

12 == LTE + WCDMA, for more details see ril.h

Remember to set preferred_network_mode1 and preferred_network_mode2 and preferred_network_mode3

-1
source

Source: https://habr.com/ru/post/973847/


All Articles