python+scrcpy實現將安卓設備錄屏并保存到pc本地
一)scrcpy下載及安裝
參考鏈接:https://zhuanlan.zhihu.com/p/80264357
windows64位系統下載地址:https://github.com/Genymobile/scrcpy/releases/download/v1.13/scrcpy-win64-v1.13.zip
Mac安裝:brew install scrcp
二)python+scrcpy實現將安卓設備錄屏并保存到pc本地
示例代碼:
import os,datetime def screenrecords(): now_time = datetime.datetime.now().strftime('%Y-%m-%d_%H-%M-%S') path = r'F:\screen\video_{}.mp4'.format(now_time) command = 'scrcpy -r {}'.format(path) try: print('錄屏開始!') os.system(command) except: print('錄屏失敗!') print('錄屏結束!') if __name__ == '__main__': screenrecords()
友情鏈接:http://www.rzrgm.cn/lxmtx/p/16202967.html
三)多設備投屏
1、保證多個設備在同一個局域網下
2、多個設備全部開啟了開發者模式下的調試
3、用usb線把其中一個手機和電腦連接起來,確保可調試
4、查看是否有設備存在:adb devices
5、執行命令:adb tcpip 5555
6、斷開USB使用無線鏈接adb: (開啟兩個cmd窗口)
adb connect tcpip1:5555
adb connect tcpip2:5555
7、在兩個cmd窗口分別啟動scrcpy
scrcpy -s tcpip1:5555
scrcpy -s tcpip2:5555
8、結束后斷開無線adb連接
adb disconnect tcpip1:5555
adb disconnect tcpip2:5555

浙公網安備 33010602011771號