How to turn off Radio Signal via adb without airplane mode? As I'm trying to make a script to restart radio signal and I'm not using usb cable for adb, I need to turn off my mobile signal WITHOUT using airplane (because I'm using Wifi Hotspot and Wifi ADB).

Is there a solution for that?
I have root and wifi adb running smoothly... and I have seen some solution as disabling mobile data and so on but this is not enough for me. My carrier sometimes stop providing me mobile connection and the only way to get active mobile data is to restart the radio signal (just as I'd do if I type ##4636*#*# and press the "turn off/on radio" button).

Also if possible, after turning off radio signal, I'd need to wait +- 10 seconds before going on again (I suppose the command for that is sleep 10).

Thanks :D

PS: Android Lollipop 5.1.1 (Xperia Z1)
I need to turn off my mobile signal WITHOUT using airplane (because I'm using Wifi Hotspot and Wifi ADB).


You can configure your device to not stop  Wi-Fi (Hotspot includes) when activating Airplane mode.

(Note: I tested the solution in Android 4.2.1, 4.4.2, 5.0.2 and 5.1.1.)

The radios that are supposed to be turned off when Airplane mode gets enabled are saved  in the key airplane_mode_radios under the table global inside /data/data/com.android.settings/databases/settings.db (Settings Storage app's database).

Set up adb in PC, enable USB debugging in device, connect it into PC, launch a shell and enter either one of the command

adb shell settings get global airplane_mode_radios
adb shell content query --uri content://settings/global  --projection name:value --where "name='airplane_mode_radios'"


(See usage of settings and content command using adb shell settings and adb shell content)

Given the command you executed you would see something like (either one of the result):

cell,bluetooth,wifi,nfc,wimax
Row: 0 name=airplane_mode_radios, value=cell,bluetooth,wifi,nfc,wimax


You can choose to remove wifi from the value to achieve the final objective.

Enter any one of the commands:

adb shell settings put global airplane_mode_radios  "cell,bluetooth,nfc,wimax"
adb shell content update --uri content://settings/global --bind value:s:'cell,bluetooth,nfc,wimax' --where "name='airplane_mode_radios'"


Note: Do not copy-paste. Note the string that you got in the first output. Then remove wifi, from it and then pass the resultant between the double quotes "" the way I've shown above. 

Now you can turn on the Wi-Fi/Hotspot followed by the Airplane mode. Your Wi-Fi/Hotspot wouldn't turn off.

The need for using ADB was meant for once only.  If you decide to stop Wi-Fi when Airplane mode becomes active then simply add  wifi in that key's value. 

Answer originally written for Possible to turn on Airplane mode with WiFi on only?