手機在開發者選項里要開啟無線調試
在手機設置中查看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