简体   繁体   English

使用 ADB 不丢失 Wifi 和蓝牙的飞行模式

[英]Airplane Mode with out lose Wifi and Bluetooth using ADB

I am trying to enable/disable Airplane mode via ADB commands.我正在尝试通过 ADB 命令启用/禁用飞行模式。

I have found the following adb commands for enable or disable Airplane mode.我发现以下用于启用或禁用飞行模式的 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

But, wifi and bluetooth connection will be lost.但是,wifi 和蓝牙连接将丢失。 How can I execute aadb for flight mode with out lose wifi and bluetooth如何在不丢失 wifi 和蓝牙的情况下为飞行模式执行 aadb

Start ADB shell:启动亚行外壳:

adb shell

Set parameter airplane_mode_radios to whatever you want airplane mode to switch off.将参数airplane_mode_radios设置为您想要关闭飞行模式的任何值。 Possible values include cell,bluetooth,wifi,nfc,wimax .可能的值包括cell,bluetooth,wifi,nfc,wimax For your needs exclude bluethooth:对于您的需求,排除蓝牙:

settings put global airplane_mode_radios cell,wifi,nfc,wimax

To remove this setting and return defaults to airplane mode run:要删除此设置并将默认值恢复为飞行模式,请运行:

delete global airplane_mode_radios

There's also airplane_mode_toggleable_radios setting which controls radios to be enabled again after turning airplane mode off.还有airplane_mode_toggleable_radios设置,它控制在关闭飞行模式后再次启用无线电。 See answer on SO .请参阅SO 上的答案

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM