指令
查询adb端口占用 第一个非adb.exe 则清理掉该进程
netstat -ano|findstr "5037"
wifi调试(需root)
usb 连接手机
adb tcpip 5555
adb shell ifconfig wlan0
adb connect 手机ip地址
查看机型
adb shell getprop ro.product.model
获取屏幕分辨率
adb shell dumpsys window displays
adb shell wm size
抓取崩溃日志
adb logcat -v time >.\\logcat.log
安装APK
adb install -r XXXX
卸载APK
adb uninstall APK的包名
覆盖低版本APK
adb install -r D:\xx\xxx\xx\xxx\xxx.apk
覆盖高版本APK
adb install -r -d D:\xx\xxx\xx\xxx\xxx.apk
多个设备时装包/指令
adb -s 设备号 install XXX
adb -s 设备号 adb 命令
获取包名和主Activity(该应用开启状态)
adb shell dumpsys window w | grep mCurrent
adb shell dumpsys activity | grep mFocusedActivity
adb shell dumpsys window | findstr mCurrentFocus
启动APK
adb shell am start com.ss.android.ugc.aweme.lite/com.ss.android.ugc.aweme.main.MainActivity
adb shell am start -W -n com.ss.android.ugc.aweme.lite/com.ss.android.ugc.aweme.main.MainActivity
关闭APK
adb shell am force-stop com.ss.android.ugc.aweme.lite
清除数据和缓存
adb shell pm clear com.ss.android.ugc.aweme.lite
截图
adb shell screencap -p /sdcard/01.png(截屏)
adb pull /sdcard/01.png(下载截图)
删除文件夹
工具
获取屏幕点击位置
[article]
[source-code]