使用亚行检查,如果飞行模式已开启? [英] Use ADB to check if Airplane mode is turned on?
问题描述
我知道我们可以做到以下几点:
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
要打开/关闭飞行模式在Android设备上。
to turn on/off airplane mode on android device.
不过,反正是有检查,如果目前该设备已通过ADB飞行模式开启?
However, is there anyway to check if currently the device has airplane mode turned on through ADB ?
我问这是因为两行code以上将切换飞行模式,而不知道它是否被开启或关闭它。但是,我需要一种方法来确保飞行模式的确是在关亚行/。
I'm asking this because the two lines of code above will toggle airplane mode without knowing whether it is turning it on or off. But I need a way to make sure that airplane mode is indeed on/off through ADB.
请帮助我!
在此先感谢
推荐答案
亚行shell设置获得全球airplane_mode_on
返回 0
对于airplane_mode关闭, 1
的airplane_mode上。
adb shell settings get global airplane_mode_on
returns 0
for airplane_mode off and 1
for airplane_mode on.
这篇关于使用亚行检查,如果飞行模式已开启?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!