工作常用adb命令

2019-04-03  本文已影响0人  Anivia_Hanger


连接

建立连接 adb connect ip

销毁连接 adb disconnect

安装

安装 adb install xxx.apk

卸载 adb uninstall 包名

启动app

adb shell am start -n 包名/路径

如 adb shell am start -n com.android.helloword/com.android.helloword.MainActivity

传文件

adb push 文件路径  /需要放置的设备sd卡路径

如 adb push C:\Users\Administrator\Desktop\test /sdcard

pull文件到电脑指定位置

adb pull 文件路径  需要放置的路径

如拿到sd卡下面的test文件夹到电脑桌面 adb pull /sdcard/test C:\Users\Administrator\Desktop 

查看运行APP日志

adb shell logcat -s TAG:日志级别

如 adb shell logcat -s MainActivity:I

退出APK

adb shell am force-stop 包名

如 adb shell am force-stop com.android.helloword

查看设备名称

adbshell getprop ro.product.model

查看设备分辨率

adb shell wm size

或者 adb shell dumpsys window displays  用这个的时候 看app=480x360,根据这个设置dimens

获取WLAN的mac地址

adb shell cat/sys/class/net/wlan0/address

截屏

adb shell screencap -p /sdcard/pic/pic.png

上一篇 下一篇

猜你喜欢

热点阅读