1. 查询进程占用端口
netstat -ano|findstr "端口号"
2. 查询任务ID
tasklist |findstr "端口号"
3. 杀掉进程
tasklist /f /pid "端口号"
4. 安装apk
adb install -r "apk路径"
5. 查询app包名
aapt dump bading "apk路径"|fingstr package
6. 实时监听进程变化
adb shell "top|grep com.huhuo.asdwq(包名)"
7. 查看PID进程状态
adb shell ps -x PID
8. 监听进程状态
adb shell "top -n 10(监听次数)|grep com.huohu.auto(包名)"
9. 查看app的activity值
aapt dump bading "apk路径"|findstr activity
10. 重启app
adb shell am start -W -n com.huhuo.auto(包名)/com.huohu.auto.activity.Startivity(activity值)
11. 停止app但不会清除进程在系统中产生的数据
adb shell am force-stop com.sohu.sohuvido(包名)
12. 停止并清除app在系统中产生的数据
adb shell am force-stop com.sohu.sohuvido(包名)
13. Top用法
adb shell top -m num -n nm -d num -s col -t -h|grep com.huohu.auto(包名)
-m num 最多显示num个进程
-n num 刷新次数
-d num 刷新间隔时间(默认为5秒)
-s col 按哪列排序
-t 显示线程信息而不是进程
-h 显示帮助文档
14. 截图
adb shell system/bin/screencap(设备路径) -p /sdcard/text.png(图片名)
adb push /sdcard/text.png(图片路径) C:\Users\Desktop(电脑路径)