Toggle airplane mode and Wi-Fi via ADB Shell

Article ID: 82334326

Issue / Question

How to enable and disable airplane mode and Wi-Fi by using ADB shell

Applicable To

TC20, TC25

Resolution / Answer

Please ensure a device has enabled the USB debugging before start the ADB command (Read More>>)


To enable/disable the Airplane mode, please use the following adb commands:
1. To launch the Airplane option on Settings 
adb shell am start -a android.settings.AIRPLANE_MODE_SETTINGS 
2. To disable or enable the airplane mode, following command will toggle the button to opposite mode.
adb shell input keyevent 19 & adb shell input keyevent 19 & adb shell input keyevent 23

To enable/disable the Wi-Fi, please use the following adb commands: 
1. To launch the Wifi option on Settings
adb shell am start -a android.intent.action.MAIN -n com.android.settings/.wifi.WifiSettings 
2. To disable or enable the wifi mode, following command will toggle the button to opposite mode.
adb shell input keyevent 19 & adb shell input keyevent 19 & adb shell input keyevent 23

+ Applicable Products

  • TC20
  • TC25