Skip to content

Instantly share code, notes, and snippets.

@n3k0lai
Created December 2, 2021 01:40
Show Gist options
  • Save n3k0lai/699f79d054061fc9c2a3a900dd025bdd to your computer and use it in GitHub Desktop.
Save n3k0lai/699f79d054061fc9c2a3a900dd025bdd to your computer and use it in GitHub Desktop.
mirrorandroid.ps1
# this script runs an android mirroring
# program optimized for capture by stream
# https://github.com/Genymobile/scrcpy
$scrcpyDir = 'C:\Program Files\scrcpy-win64\'
$recordingsDir = 'D:\phone recordings\'
# --no-display
$AllArgs = @('--max-size', '1920', '--bit-rate', '2m')
# if big drive is connected, then record
If (Test-Path D:) {
$filename = Get-Date -UFormat "recording-%Y-%m-%d-%H:%M:%S"
$AllArgs += '--record'
$AllArgs += $recordingsDir + $filename
}
cd $scrcpyDir
& $scrcpyDir'scrcpy.exe' $AllArgs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment