背景
在很多定制Android系统中,由于移除了系统设置APP,导致调试设备时很多实用的调试开关无法通过GUI开启,但实际功能还是存在的,此时可以尝试通过adb命令开启。
常用功能开关
开发者选项开关状态保存在settings的global表中,具体如下:
1. 开发者选项
bash
adb shell settings put global development_settings_enabled 1
2. USB 调试
bash
adb shell settings put global adb_enabled 1
3. 模拟位置
bash
adb shell settings put secure mock_location 1
5. 不要保持活动
bash
adb shell settings put global always_finish_activities 1
6. 显示触摸
bash
adb shell settings put system show_touches 1
7. 显示指针位置
bash
adb shell settings put system pointer_location 1
8. 让后台进程运行
bash
adb shell settings put global background_process_limit 10
9. 关闭或开启 GPU 渲染
bash
adb shell settings put global debug_gpu_overdraw 1 开启
adb shell settings put global debug_gpu_overdraw 0 关闭
10. 运行时权限
bash
adb shell settings put global runtime_permission 1 开启
adb shell settings put global runtime_permission 0 关闭
11. 允许 OEM 解锁
bash
adb shell settings put global oem_unlock_allowed 1