0

我正在尝试通过 ADB 命令启用/禁用飞行模式。

我找到了以下用于启用或禁用飞行模式的 adb 命令。

adb shell settings put global airplane_mode_on 1
adb shell am broadcast -a android.intent.action.AIRPLANE_MODE

adb shell settings put global airplane_mode_on 0
adb shell am broadcast -a android.intent.action.AIRPLANE_MODE

但是,wifi和蓝牙连接会丢失。如何在不丢失 wifi 和蓝牙的情况下为飞行模式执行 aadb

4

1 回答 1

2

启动亚行外壳:

adb shell

将参数设置airplane_mode_radios为您希望关闭飞行模式的任何内容。可能的值包括cell,bluetooth,wifi,nfc,wimax. 对于您的需要排除蓝牙:

settings put global airplane_mode_radios cell,wifi,nfc,wimax

要删除此设置并将默认设置返回到飞行模式,请运行:

delete global airplane_mode_radios

还有一个airplane_mode_toggleable_radios设置是在关闭飞行模式后控制无线电再次启用。请参阅SO 上的答案

于 2019-12-03T08:30:11.493 回答