通过ADB打开飞行模式 [英] Turning airplane mode on via ADB

查看:1156
本文介绍了通过ADB打开飞行模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经找遍了,我还没有找到一个具体的回答了这个问题。我希望能找到一个方法来切换亚行飞机模式,不涉及以任何方式GUI。我发现和使用的调出菜单,然后使用的KeyEvent开启飞行模式的方法,但由于需要考虑到在UI布局可能出现的变化,这种方法只治标不治本。

我开始觉得没有办法,只是切换飞行模式通过有意或关闭,但如果您有任何信息,我会非常AP preciate吧。

解决方案

 亚行外壳上午开始-a android.settings.AIRPLANE_MODE_SETTINGS
亚行的shell输入的keyEvent 19安培;亚行的shell输入的keyEvent 23
 

I've looked all over and I haven't found a concrete answer to this question. I'm hoping to find a way to toggle airplane mode from ADB that doesn't involve the GUI in any way. I've found and used the method that calls up the menu and then using keyevents turns airplane mode on, but due to needing to account for possible changes in UI layout, this method is only a temporary solution.

I'm beginning to think there isn't a way to just toggle airplane mode on or off via intent, but if you have any information, I'd greatly appreciate it.

解决方案

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

这篇关于通过ADB打开飞行模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆