python+scrcpy实现将安卓设备录屏并保存到pc本地

2023-03-10,,

一)scrcpy下载及安装

参考链接:https://zhuanlan.zhihu.com/p/80264357

二)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()

友情链接:https://www.cnblogs.com/lxmtx/p/16202967.html

python+scrcpy实现将安卓设备录屏并保存到pc本地的相关教程结束。

《python+scrcpy实现将安卓设备录屏并保存到pc本地.doc》

下载本文的Word格式文档,以方便收藏与打印。