手机在开发者选项里要开启无线调试
在手机设置中查看WiFi的IP地址
设置 -> WLAN -> 已连接的WiFi -> IP地址
使用手机的IP地址连接
adb connect 192.168.1.12:xxxxx
检查连接状态
adb devices
断开特定设备
adb disconnect 192.168.x.x:xxxxx
断开所有设备
adb disconnect
关闭USB摄像头服务
adb shell am force-stop com.shenyaocn.android.usbcamera
开启USB摄像头服务
adb shell am startservice -n com.shenyaocn.android.usbcamera/.USBCameraService
找到你想调试的应用的包名,需要在手机上打开应用
adb shell dumpsys window | findstr “mCurrentFocus”
转自cursorAI提供
先获取应用的 PID
adb shell ps | findstr “com.shenyaocn.android.usbcamera”
清除日志
adb logcat -c
然后使用 PID 过滤日志,(查看所有日志)
adb logcat --pid=2849 2849是你自己的进程ID