adb命令的使用

查看当前包名: adb shell “dumpsys window | grep mCurrentFocus”

查看设备信息: adb devices

安装APP: adb install+安装包所在位置

卸载APP: adb uninstall+APP包名

截取手机屏幕:
adb shell uiautomator dump /sdcard/app.uix
adb pull /sdcard/app.uix E:/app.uix
adb shell screencap -p /sdcard/app.png
adb pull /sdcard/app.png E:/app.png

杀掉adb进程: adb kill-server

重启adb服务: adb start-server

重启手机: adb reboot

输出日志:
第一种:输出到手机存储卡
adb logcat > /sdcard/mylogcat.txt
第二种:输出到电脑上
adb logcat > D:/Temp/1.txt(1.txt必须在电脑上存在,才能写入logcat内容)

从电脑发文件到手机: adb push <本地路径> <远程路径>

从手机下载文件到本地: adb pull <远程路径> <本地路径>

进shell模式: adb shell

挂载: adb remount

猜你喜欢

转载自blog.csdn.net/weixin_40412060/article/details/82854540