Android截屏,录视频批处理脚本

echo off
goto choice
:choice
  set /p cnum=请输入1(截屏)2(录屏): 
  echo %cnum%
if %cnum% == 1 (goto screencap) else ( if %cnum% == 2 (goto screenrecord) else (goto another))
:screencap
  rem 选择截屏操作
  set "a=%date:~0,4%.%date:~5,2%.%date:~8,2%.%time:~0,2%.%time:~3,2%.%time:~6,2%.%time:~9,2%" 
  set "filepng=filepng%a%.png"
  set "location=%cd%"
  adb shell /system/bin/screencap -p /sdcard/%filepng%
  adb pull /sdcard/%filepng% %location%
  goto choice
  exit
:screenrecord
  rem 选择录屏操作
  set "a=%date:~0,4%.%date:~5,2%.%date:~8,2%.%time:~0,2%.%time:~3,2%.%time:~6,2%.%time:~9,2%"  
  set "filemp4=screenshot%a%.mp4"
  set "location=%cd%"
  set /p m=录制几秒?:
  adb shell screenrecord  --time-limit %m% /sdcard/%filemp4%
  adb pull /sdcard/%filemp4% %location%
  goto choice
  exit 
:another
  goto choice

你可能感兴趣的:(Android截屏,录视频批处理脚本)