Use ADB to check if Airplane mode is turned on?

前端 未结 2 1057
别那么骄傲
别那么骄傲 2021-02-06 13:50

I know that we can do the following:

adb shell am start -a android.settings.AIRPLANE_MODE_SETTINGS
adb shell input keyevent 19 ; adb shell input keyevent 23
         


        
2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-06 14:32

    You can use the following commands after doing adb shell.

    Turn on:
    adb shell settings put global airplane_mode_on 1
    adb shell am broadcast -a android.intent.action.AIRPLANE_MODE --ez state true

    Turn off:
    adb shell settings put global airplane_mode_on 0
    adb shell am broadcast -a android.intent.action.AIRPLANE_MODE --ez state false

    This will make airplane mode ON/OFF

提交回复
热议问题