Use ADB to check if Airplane mode is turned on?

前端 未结 2 1059
别那么骄傲
别那么骄傲 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

    0 讨论(0)
  • 2021-02-06 14:34

    adb shell settings get global airplane_mode_on returns 0 for airplane_mode off and 1 for airplane_mode on.

    0 讨论(0)
提交回复
热议问题