常用 ADB 命令

常用 ADB 命令 - 简书

TiTleHow
修改电量adb shell dumpsys battery set level 100
查看蓝牙信息adb shell dumpsys bluetooth_manager
查看Wi-Fi 信息adb shell dumpsys wifi
待确认adb shell svc power stayon [true/false/usb/ac] 设置屏幕的常亮,true保持常亮,false不保持,usb当插入usb时常亮,ac当插入电源时常亮
输出缓存grep --line-buffered
Turn on/off mobile dataadb shell svc data [enable/disable]
性能adb shell top -d 1 -m 10 -t
强制生成trace/data/anr/traces.txt
Exception logadb logcat -s */E
settings key 存储数据库/data/data/com.android.providers.settings/databases/settings.db
查看飞行模式adb shell settings get global airlpane_mode_on
查看WiFi 状态1:开 0:关 adb shell settings get global wifi_on
开关WIFIadb shell svc wifi enable/disable
获取macadb shell cat /sys/class/net/wlan0/address
格式化时间adb shell date +"%Y%m%d%H%M%S"
长按input keyevent --longpress
启动时间获取adb logcat -c && adb logcat -s ActivityManager
屏幕adb shell getevent -p grep -E "0035|0036"
分辨率adb shell wm size
获取屏幕密度wm density
数据开关adb shell svc data enable/disadle
GPS&基站开adb shell settings put secure location_providers_allowed +gps,+network
GPS&基站关adb shell settings put secure location_providers_allowed -gps,-networknetwork:基站定位 gps:GPS定位
屏幕休眠时间(毫秒)adb shell settings get system screen_off_timeout
设置屏幕休眠时间(毫秒)adb shell settings put system screen_off_timeout 600000
View Hierarchy:adb shell dumpsys activity top
挂断电话adb shell service call phone 3
make calladb shell am start -a android.intent.action.CALL -d tel:10010
前台activityadb shell dumpsys window | grep mCurrentFocus
强制停止运行apkadb shell am force-stop
获取包名listadb shell pm list packages
检查设备是否亮屏dumpsys power | grep 'Display Power: state'
信号adb shell dumpsys telephony.registry
充电状态dumpsys battery &#124 grep powered
驻网类型getprop gsm.network.type
运营商类型getprop gsm.operator.alpha
休眠策略# kernel休眠
echo mem > /sys/power/state
# kernel唤醒echo on > /sys/power/state
echo a > /sys/power/wake_lock
echo a > /sys/power/wake_unlock
清除软件数据pm clear "com.mobvoi.ticscreen.dialer"
禁用系统充电adb shell settings put secure disable_charge_page 1adb shell dumpsys battery unplug
截屏wm screen-captureadb shell screencap -p /sdcard/demo.png
通话状态dumpsys telephony.registry | grep mCallState
锁网adb shell am start -n com.qualcomm.qti.networksetting/.MobileNetworkSettings
WIFI 调试ifconfig
adb tcpip 5555
adb connect <device-ip-address>
联系人数据库adb pull /data/data/com.android.providers.contacts/databases
DNSgetprop | grep dns
audio大小adb shell dumpsys audio | grep speaker
Wlan信号获取信号强度
cat /proc/net/wireless | grep wlan0 | awk '{print $3}'
获取信号质量:单位dBm
cat /proc/net/wireless | grep wlan0 | awk '{print 5}'
网口的传输速率:Mb/s = 1000000bps
iwconfig wlan0 | sed 's/ /\n/g' | grep -i Rate | sed 's/=/ /g'|awk '{print $2}'
允许安装来源apk adb shell settings put secure install_non_market_apps1
获取自动锁屏时间adb shell settings list system | grep timeout
设置永不锁屏adb shell settings put system screen_off_timeout 2147483647
代理 设置代理adb shell settings put global http_proxy 127.0.0.1:8888
移除代理adb shell settings delete global http_proxy
adb shell settings delete global global_http_proxy_host
adb shell settings delete global global_http_proxy_port adb reboot
卸载apppm uninstall -k --user 0 package
获取imei windowsadb shell "service call iphonesubinfo 1 | grep -o '[0-9a-f]{8} ' | tail -n+3 | while read a; do echo -n \u${a:4:4}\u${a:0:4}; done"
获取imei windowsadb shell service call iphonesubinfo 1 | awk -F "'" '{print $2}' | sed '1 d' | tr -d '.' | awk '{print}' ORS=
获取imei linuxadb shell 'service call iphonesubinfo 1 | grep -o "[0-9a-f]{8} " | tail -n+3 | while read a; do echo -n "\u${a:4:4}\u${a:0:4}"; done'
更改屏幕亮度adb shell settings put system screen_brightness 150
获取屏幕亮度adb shell settings get system screen_brightness

adb disable-verity 


作者:非著名自行车运动员
链接:https://www.jianshu.com/p/bae933aac556
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值