常用ADB命令

1、发广播
adb shell am broadcast -a com.efrobot.robot.dispath.asr.event --es question_string “开启超声波标定” --es mode_string “ULTRASONIC_CALIBRATION”

2、强制停止app运行
adb shell am force-stop com.efrobot.guest

3、挂载存储卡,这样后方可读写
adb remount

4 运行shell命令
.adb shell

5、进入某目录
.cd system/app

6、查看目录
ls

7、删除某apk
rm robot-core.apk

8、删除logs文件夹目录
rm -r logs

9、回到最上层目录
exit

10、重启
adb reboot

11、起services或者activity
adb shell am start -n com.efrobot.robot.services/.MainActivity

12、起robot://ainirobot.robotkid/localplay为隐示意图的某activity,同时传入参数
adb shell am start -d ‘robot://ainirobot.robotkid/localplay?media=[{“cid”:“126e91a63e-9140-5e7e-a282-fdb6a32288c9”}]’

13、关机
adb shell reboot -p

//命令行cmd下的命令
14、查找android文件里面FATAL相关的行 (一般用于android日志查找崩溃)
cat android |grep -E “FATAL”

15、查找sound开头相关的has diead 相关的行
grep “sound.*has died” android

16、查找android文件下的sound.开头has died相关前200行
grep “sound.*has died” android -B 200

16、后200行
grep “sound.*has died” android -A 200

17、统计SN L1A11出现了多少次
cat android |grep -E “SN L1A11” -c

18 、切割android文件以每个300M为一个文件
split -b 300m android newfile

19、查找日志中ANR相关
grep “ANR Input dispatching timed out” android*
grep “ANR executing service” android*
grep “InputDispatcher: Application is not responding” android*

20、 日志拉取
adb logcat > log0919.log

21、清除logcat缓存并输出日志
adb logcat -c && adb logcat > C:\test3.txt

22、获取当前栈里的activity
adb shell dumpsys activity activities | grep -i run

23、查看栈顶Activty
adb shell dumpsys activity | findstr “mFocusedActivity”

24、查看栈列表
adb shell dumpsys activity activities

25、 清理app数据
adb shell pm clear com.ainirobot.coreservice

26、停止adb服务
adb kill-server

27、开启adb服务
adb start-server

29、查看占用cpu前10的进程
adb shell top -m 10 -d 1

------------adb无线连接-----------------------------------------------------------------------------------

adb tcpip 8888

adb shell ifconfig

adb connect 10.60.197.61:123

adb connect 192.168.1.28:7777
adb kill-server

adb connect 192.168.1.28:5555
----------------adb安app--------------------------------------------------------------------------------------
相同签名的包,高版本安装 adb install -r

相同签名的包,低版本先 cd system/app/ 然后 rm-r coreservices 然后再安装 adb install -r

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值