android adb 常用命令

1. adb logcat   查看所有Log信息


2. adb logcat -c  清除当前屏的log信息

  adb logcat -v time  同时打印时间



3. adb logcat -s TAG  过滤标签为TAG的log信息,只看自己想看的Log


4. adb logcat > log.log 保存log信息到本地,就是linux重定向命令,有时候log打印很快无法查看可用此方法,定位crash问题可搜关键字FATAL或Exception,或apk的包名


5. adb logcat -b <main|system|radio|event> 系统log分类信息


6. adb logcat -t <count>  只打印count行log


7. adb shell dmesg 打印系统内核log


8. 


9. adb shell am broadcast 发送广播
   参数:
   1)-a Action                    adb shell am broadcast -a com.tianyu.system.data
   2) --es 传递String类型Extra     adb shell am broadcast -a com.tianyu.system.data --es teststring "123"  //teststring 为key   123为value
   3) --ei 传递int类型Extra        adb shell am broadcast -a com.tianyu.system.data --ei testint 123
   4) --ez 传递boolean类型Extra    adb shell am broadcast -a com.tianyu.system.data --ez testboolean true


更多adb shell am的用法 adb shell am --help


10. 安装APK
   adb install -r music.apk //-r 表示删除之前的文件
   卸载apk
   adb uninstall +包名 //eg: adb uninstall com.tianyu.music


11. 系统权限
    adb root //获取系统root权限,需eng版或系统user版已开放
    adb remount //重新装载android系统文件


12.adb 端口被占用
1、执行下面命令:adb nodaemon server 会出现 cannot bind 'tcp:5037'
2、输入下面的命令:netstat -ano | findstr "5037" 可以查询什么占用了5037端口,
   再通过 taskkill /f /pid xxxx 把占用5037端口的进程给Kill掉就好,
   再运行一次netstat -ano | findstr "5037"
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

LakeSideHu

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值