Scrcpy使用
下载安装包
在scrcpy里打开cmd
1、先有线链接
scrcpy -d
2、设置pcpip
scrcpy --pcpip
息屏链接
scrcpy --turn-screen-off -e
adb devices连接设备失败offline
1.设备USB连接电脑,电脑提示已连接,并且文件传输正常,但是adb devices提示offline
2.打开cmd,依次输入adb kill-server、adb start-server、adb shell
其他原因:
1、开发者选项,USB调试未打开
2、adb版本低,进行升级
adb device 查看设备
设置无窗口打开
新建一个bat脚本
start.bat
@echo off
start /b cmd /c "scrcpy --stay-awake --turn-screen-off -e"
restart.bat
@echo off
rem 切换到scrcpy安装目录
cd /d "D:\Program Files\scrcpy-win64-v2.0"
rem 执行scrcpy --tcpip
scrcpy --turn-screen-off -e
再新建一个vbs
start.vbs
strComputer = "."
adbProcess = "adb.exe"
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colProcesses = objWMIService.ExecQuery("SELECT * FROM Win32_Process WHERE Name = '" & adbProcess & "'")
Set ws = CreateObject("Wscript.Shell")
If colProcesses.Count > 0 Then
ws.run "cmd /c restart.bat",vbhide
WScript.Echo "正在无线连接 请稍等"
Else
WScript.Echo "首次连接 请插线后重连"
ws.run "cmd /c start.bat",vbhide
End If
将这两个文件跟上面scrcpy.exe同目录
设置保持唤醒状态
scrcpy --stay-awake
adb connect 192.168.5.126:5555
标签:scrcpy,bat,--,cmd,start,adb From: https://www.cnblogs.com/hgdsblog/p/17471578.html