adb常用指令

Android Debug Bridge

 

烧录boot:

adb reboot bootloader

fastboot flash boot boot.img

fastboot reboot

 

 烧录system:

adb reboot bootloader

fastboot flash system system.img

fastboot reboot

 

黑屏情况下,只有adb口没有diag口时,如何烧录系统?
 
adb reboot bootloader
fastboot erase aboot
fastboot reboot
此时diag口出现可以直接烧录

  

adb shell中命令:

     getevent ----- 获取操作命令

     logcat ----- 打印应用程序的log

     dmesg > /data/1.txt ------ 抓取log信息到1.txt

      adb pull /data/1.txt d:/   ------ 将data文件夹中1.txt pull进d盘

      logcat –s alsa_ucm  -------  过滤alsa_ucm开头的系统日志

adb shell am start -n com.android.music/com.android.music.MediaPlaybackActivity -d /sdcard/jmzcg.mp3
这个命令可以让android播放TF卡中的MP3

  

出现如下问题:

D:\>fastboot flash boot D:\Users\Desktop\boot.img
target reported max download size of 268435456 bytes
sending 'boot' (16283 KB)...
OKAY [  0.515s]
writing 'boot'...

FAILED (remote: device is locked. Cannot flash images)
finished. total time: 0.529s

解决办法:

fastboot oem unlock-go

修改电量:    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 data:    adb shell svc data [enable/disable]
性能:    adb shell top -d 1 -m 10 -t
强制生成trace:    /data/anr/traces.txt
Exception log:    adb 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
开关WIFI:    adb shell svc wifi enable/disable
获取mac:    adb 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 call:    adb shell am start -a android.intent.action.CALL -d tel:10010
前台activity:    adb shell dumpsys window | grep mCurrentFocus
强制停止运行apk:    adb shell am force-stop
获取包名list:    adb 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
DNS:    getprop | 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
卸载app:  pm uninstall -k --user 0 package
获取imei windows:    adb 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 windows:    adb shell service call iphonesubinfo 1 | awk -F "'" '{print $2}' | sed '1 d' | tr -d '.' | awk '{print}' ORS=
获取imei linux:    adb 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 shell  input keyevent 26,再发一下灭屏
关机: adb shell reboot -p
查看进程: ps -ef
杀进程: kill -9 pid

返回上个界面:
adb shell input keyevent BACK

查看正在使用的pcm设备: lsof | grep -i pcm

//内存dump
adb shell dumpsys meminfo

//电源dump
adb shell dumpsys power

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值