赞
踩
1 需求
2 语法
- C:\>adb shell settings help
- Settings provider (settings) commands:
- help
- Print this help text.
- get [--user <USER_ID> | current] NAMESPACE KEY
- Retrieve the current value of KEY.
- put [--user <USER_ID> | current] NAMESPACE KEY VALUE [TAG] [default]
- Change the contents of KEY to VALUE.
- TAG to associate with the setting.
- {default} to set as the default, case-insensitive only for global/secure namespace
- delete [--user <USER_ID> | current] NAMESPACE KEY
- Delete the entry for KEY.
- reset [--user <USER_ID> | current] NAMESPACE {PACKAGE_NAME | RESET_MODE}
- Reset the global/secure table for a package with mode.
- RESET_MODE is one of {untrusted_defaults, untrusted_clear, trusted_defaults}, case-insensitive
- list [--user <USER_ID> | current] NAMESPACE
- Print all defined keys.
- NAMESPACE is one of {system, secure, global}, case-insensitive

3.X 示例:Developer options
adb shell settings get global development_settings_enabled
3.X 示例:USB调试
获取USB调试状态
adb shell settings get global adb_enabled
开启 USB调试
adb shell settings put global adb_enabled 1
关闭 USB调试
adb shell settings put global adb_enabled 0
3.X 示例:飞行模式 设置
方法一:
查看飞行模式状态
adb shell settings get global airplane_mode_on
打开飞行模式
adb shell settings put global airplane_mode_on 1
关闭飞行模式
adb shell settings put global airplane_mode_on 0
方法二:
adb shell am broadcast -a android.intent.action.AIRPLANE_MODE --ez state true/false
参考资料:
如何通过adb打开和关闭飞行模式_丨一念丨的博客-CSDN博客_adb 飞行模式
3.X 示例:自动息屏 设置(2147483647)
获取当前息屏时间
adb shell settings get system screen_off_timeout
修改自动息屏时间
adb shell settings put system screen_off_timeout 2147483647
3.X 屏幕自动调整亮度
查询 自动调整亮度 状态
adb shell settings get system screen_brightness_mode
开启 自动调整亮度
adb shell settings put system screen_brightness_mode 1
关闭 自动调整亮度
adb shell settings put system screen_brightness_mode 0
3.X 屏幕亮度 设置(0-255)
查询 当前 屏幕亮度值
adb shell settings get system screen_brightness
设置 屏幕亮度值
adb shell settings put system screen_brightness 255
3.X 屏幕旋转
查看 屏幕旋转 当前状态
adb shell settings get system accelerometer_rotation
启动 自动旋转
adb shell settings put system accelerometer_rotation 1
关闭 自动旋转
adb shell settings put system accelerometer_rotation 0
3.X 示例:位置信息
打开 位置信息 设置页面
adb shell am start -a android.settings.LOCATION_SOURCE_SETTINGS
查看定位状态
adb shell settings get secure location_providers_allowed
开启定位
adb shell settings put secure location_providers_allowed +gps
adb shell settings put secure location_providers_allowed +network
关闭定位
adb shell settings put secure location_providers_allowed -gps
adb shell settings put secure location_providers_allowed -network
3.X 示例:获取android_id
adb shell settings get secure android_id
3.X 示例:获取GPP默认值
1111
3.X 示例:开机向导完成
adb shell settings get secure user_setup_complete
4 参考资料
Settings.System | Android Developers
Settings.Secure | Android Developers
Settings.Global | Android Developers
adb 命令打开系统设置界面_WCanTouch的博客-CSDN博客_adb 打开设置
Android程序获取adb状态,adb 控制手机开关/获取手机状态常用命令_风迭的博客-CSDN博客
adb操作系统开关命令_鱼啊鱼啊鱼啊的博客-CSDN博客_adb 锁屏命令
adb 操控系统命令开关:WIFI,GPS,蓝牙等_一地灬i毛的博客-CSDN博客_adb 打开gps
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。