ADB 常用命令

130 阅读1分钟

查看设备号 | adb devices 安装 | adb -s 设备号 install 包名 卸载软件 | adb -s 设备名 uninstall 软件包名(以com开始的例如:com.qqmusic) 查看安装的软件包名 | adb shell pm list package 查看所有的手机软件包名 查看第三方的手机软件包名 | adb shell pm list -3 查看手机当前使用的内存情况,各个线程的内存占用情况 | adb shell dumpsys meminfo 查看手机的电池信息 | adb shell dumpsys batteryinfo 查看系统资源状态 | adb shell top

手机日志 产看手机日志 | adb logcat 清除手机日志 | adb logcat -c 显示时间 | adb logcat -v time 将日志导入一个文件中 | adb logcat > mobile.log 将手机的图片导入到PC端 | adb pull 手机文件的路径 电脑路径 例如:Adb pull /storage/emulated/legacy/Pictures/Screenshots/Screenshot_2019-02-21-17-48-55.png F:
进入手机linux系统 adb shell monkey -p app安装包名 --throttle 25 --ignore-crashes --ignore-timeouts --ignore-security-exceptions --ignore-native-crashes --monitor-native-crashes -v -v -v 执行事件次数 >保存在pc的路径\日志名.log

设置时间的比率 | --pct-touch(percent touch) adb shell monkey -p app 安装包名 --throttle 25 --pct-touch 50 --ignore-crashes --ignore-timeouts --ignore-security-exceptions --ignore-native-crashes --monitor-native-crashes -v -v -v -s 种子数 执行事件次数 >保存在pc的路径\日志名.log(一般不设置,都选择默认的事件处理事项)

adb 命令录屏: | adb shell screenrecord --time-limit 10 /sdcard/demo.mp4 (10表示录制10秒,默认是180s)