I\'ve looked all over and I haven\'t found a concrete answer to this question. I\'m hoping to find a way to toggle airplane mode from ADB that doesn\'t involve the GUI in an
william's answer was the closest one that worked for me -> Android 5.0 Lollipop. However, sometimes it wouldn't toggle because it was trying to toggle before the Settings activity was fully loaded.
So I made the terminal sleep for 0.1 seconds. and I added hitting the back to exit out of Settings
adb shell am start -a android.settings.AIRPLANE_MODE_SETTINGS
adb shell input keyevent 19 ; sleep 0.1; adb shell input keyevent 23; sleep 0.3; adb shell input keyevent 4;
echo "Toggled airplane mode";