android adb 相关命令
2016-11-22 15:42
337 查看
android adb 相关命令
android 5.0以上获取电池信息
adb shell dumpsys batterystatshttp://www.2cto.com/kf/201510/445482.html
显示系统相关信息
adb shell cat /system/build.prop显示手机型号
adb shell cat /system/build.prop | grep build.version.sdk显示cpu使用情况
adb shell top -n 1 -d 0.5显示具体包名app的cpu使用情况
adb shell top -n 1 -d 0.5 | grep com.xx.xx
显示app内存使用情况
adb shell dumpsys meminfo com.xx.xx |grep “TOTAL”日志打印
adb logcat-v time 显示时间
-s tag1 tag2 tag3 显示不同tag日志
adb logcat -v time -s AndroidRuntime
安装卸载app
adb install xxx/xxx/xxx.apkadb uninstall com.xxx.xxx
启动app
adb start com.xxx.xxx/xxx.xxx.xxx.xxxactivity查找build.gradle文件里面的版本号
cat build.gradle | grep versionCode |awk '{print $2}' cat build.gradle | grep versionName |awk '{print $2}'
杀掉进程测试程序被杀掉的闪退
adb shell am force-stop com.example.packagename如果你有多个进程,可以在第二栏找到进程 id(PID)(如,下面第一个数字):
adb shell ps | grep com.example.packagename
然后这样杀掉:
adb shell kill PID
点击100,300的坐标
adb shell input tap 100 300
输入字符串,需要editext有焦点
adb shell input text hello
截图命令
adb shell /system/bin/screencap -p /sdcard/screentest.png
拉取图片命令
adb pull /sdcard/screentest.png /Users/lds/testtttt.png
模拟长按home(组合命令,home数值是102)
adb shell sendevent /dev/input/event0 1 102 1
adb shell sendevent /dev/input/event0 0 0 0
adb shell sleep 3
adb shell sendevent /dev/input/event0 1 102 0
adb shell sendevent /dev/input/event0 0 0 0
相关文章推荐
- Android adb基本命令-cd,ls,目录相关命令
- Android多用户相关adb命令
- Android adb基本命令-cd,ls,目录相关命令
- Android adb基本命令-cd,ls,目录相关命令
- Android adb shell相关命令
- Android adb基本命令-cd,ls,目录相关命令
- Android adb基本命令-cd,ls,目录相关命令
- 如何使用ADB命令查看Android手机相关信息参数
- Android adb命令学习笔记(一)——adb介绍以及关于传输文件等相关基本命令
- Android ADB 命令
- Android adb中命令的运行
- Android ADB 命令
- Android 安装apk文件及相关命令
- [转]Android adb不是内部或外部命令 问题解决
- android_adb命令
- Android笔记四 虚拟机Dalvik、Android各种java包功能、Android相关文件类型、应用程序结构分析、ADB
- Android系列教程(六) adb操作命令详解
- Android adb命令的使用
- Android linux adb安装操作命令图解
- Android 调试桥(adb)常用命令详解(转)