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
/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):
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?