adb常用命令

来源:互联网 发布:java ip 正则表达式 编辑:程序博客网 时间:2024/06/02 00:17

adb logcat

adb logcat --help  查看logcat帮助信息

adb logcat -v <format> 设置日志的输出格式,常用adb logcat -v time

adb logcat -c 清空日志信息,常用于开始抓取log前先清空一下

adb logcat -s 设置过滤器,例如过滤Tag为"test"的log,输入adb logcat -s test

adb logcat -d 将日志输出到屏幕上

adb logcat -f 将日志输出到sdcard,例如adb logcat -f  /sdcard/log.txt

adb logcat > 将日志输出到电脑,例如adb logcat > d:\log.txt


adb install

adb install *.apk 安装apk

adb install -r *.apk 覆盖安装apk


adb push

adb push 拷贝电脑文件到手机,adb push d:\1.txt  /sdcard/


adb pull

adb pull 拷贝手机文件到电脑, adb pull /sdcard/1.txt d:\


ddms

启动ddms


adb shell

adb shell  进入Android设备shell,查看手机中的文件等信息

adb shell dumpsys activity 查看activity栈

adb shell input text 111111 向设备文本框输入“111111”

adb shell monkey -p com.test 对process com.test进行monkey test




原创粉丝点击