文章目录
获取设备列表
adb devices
重启设备
adb reboot
获取所有包列表
adb shell pm list packages
只输出系统的包
adb shell pm list packages -s
输出所有第三方包
adb shell pm list packages -3
输出包和包相关联的文件(安装路径)
adb shell pm list packages -f
logcat 根据Tag 过滤日志
adb logcat -s " SMART_LINK_SDK" > .\\logcat.log
# -r replace existing application
# -t allow test packages
# -s install application on sdcard
# -d allow version code downgrade (debuggable packages only)
# -g grant all runtime permissions
adb -s <设备名称> install -r -t -d <apk路径>
```bash
# 查看系统进程
adb shell ps
杀死某个进程号Id对应的进程
adb shell kill 进程号id
过滤某个进程的信息,可查看进程id
adb shell ps | grep 包名
网络连接 手机
adb connect 172.16.4.37:5555
开启网络连接端口
adb tcpip 5555
断开网络连接
adb disconnect 192.168.1.5:5555
setprop service.adb.tcp.port -1
stop adbd
start adbd
启动某个页面
adb shell am start 包名/.类名
清除缓存
adb shell pm clear cn.com.test.mobile
录制屏幕
adb shell screenrecord --time-limit 10 /sdcard/demo.mp4