Turning airplane mode on via ADB

后端 未结 15 1591
暖寄归人
暖寄归人 2020-12-01 06:43

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

15条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-01 07:16

    Since the broadcast commands stopped working after Nougat, I would recommend using something like this:

    adb shell "input keyevent KEYCODE_WAKEUP;input keyevent KEYCODE_MOVE_HOME;am start -a android.settings.AIRPLANE_MODE_SETTINGS;sleep 0.5;input keyevent KEYCODE_ENTER;pm clear com.android.settings;input keyevent KEYCODE_HOME"
    

    This works on Samsung S7

提交回复
热议问题