Turning airplane mode on via ADB

后端 未结 15 1590
暖寄归人
暖寄归人 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:12

    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";
    

提交回复
热议问题