adb 操控系统命令开关:WIFI,GPS,蓝牙等
1. 获取内部版本号: adb shell getprop ro.build.display.innerver
2. 获取按键值: adb shell getevent
3. 获取apk信息: adb shell dumpsys package 包名 ->info.txt
4. 获取应用包名:adb shell dumpsys window windows | grep mFocusedApp 或者 adb shell dumpsys window windows | findstr mFocusedApp
5. 打开WiFi设置界面:adb shell am start -a android.intent.action.MAIN -n com.android.settings/.wifi.WifiSettings
6. 打开热点设置界面:adb shell am start -n com.android.settings/.TetherSettings
7. 查询蓝牙是否开启:
adb shell settings get global bluetooth_on 返回结果0代表关闭,1代表开启
adb shell dumpsys bluetooth_manager | findstr enabled 返回结果是true说明开启,false代表关闭
8. 查询WiFi是否开启:adb shell settings get global wifi_on 返回结果0代表关闭,1代表开启
9. 开启WiFi:adb shell svc wifi enable
10. 关闭WiFi:adb shell svc wifi disable
11. 打开蓝牙设置界面:adb shell am start -a android.settings.BLUETOOTH_SETTINGS
12. 获取手机休眠时间:adb shell settings get system screen_off_timeout
13. 更改手机休眠时间:adb shell settings put system screen_off_timeout 600000(10分钟)
14. 获取系统默认输入法:adb shell settings get secure default_input_method
15. 获取手机是否为自动亮度:adb shell settings get system screen_brightness_mode (0代表非自动,1代表为自动)
16. 设置手机为自动调整亮度:adb shell settings put system screen_brightness_mode 1
17. 获取手机当前亮度:adb shell settings get system screen_brightness
18. 设置手机亮度(0-255):adb shell settings put system screen_brightness 350
19. 打开定位设置界面:adb shell am start -a android.settings.LOCATION_SOURCE_SETTINGS
20. 开启定位:adb shell settings put secure location_providers_allowed +gps
21. 关闭定位:adb shell settings put secure location_providers_allowed -gps
22. 查看定位方式:adb shell settings get secure location_providers_allowed (前提是位置信息开启)
23. 拨打电话:adb shell am start -a android.intent.action.CALL tel:8888888888888
24. 发送短信:adb shell am start -a android.intent.action.SENDTO -d sms:10086(发送目的号码) --es sms_body “hello”(短信内容) --ez exit_on_sent true
25. 获取应用包名:adb shell dumpsys window windows | findstr mFocusedApp
26. 清除应用数据与缓存: adb shell pm clear cn.com.test.mobile
27. 启动应用: adb shell am start -n cn.com.test.mobile/.ui.SplashActivity
28. 停止应用:adb shell am force-stop cn.com.test.mobile
29. 飞行模式:adb shell settings set global airplane_mode_on (0=关闭,1=开启)
30. 开启\关闭飞行模式:adb shell settings put global airplane_mode_on 1\0
31. 手机震动测试(前提手机root):①adb shell ②echo ‘3000’>/sys/devices/virtual/timed_output/vibrator/enable
本文地址:https://blog.csdn.net/qq_28170363/article/details/108695746