Created
May 4, 2023 14:25
-
-
Save shinayser/b4c55823bcea2b7bb07ff0c17ccb7f76 to your computer and use it in GitHub Desktop.
Starts an Android Emulator (with completions)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Start-Emulator( | |
[ArgumentCompleter({ | |
param( | |
$CommandName, | |
$ParameterName, | |
$WordToComplete, | |
$CommandAst, | |
$FakeBoundParameters | |
) | |
return emulator -list-avds | |
})] | |
[String]$Emulator, | |
[switch]$WritableSystem, | |
[switch]$Detached | |
) { | |
$command = "emulator -avd $Emulator" | |
if ($WritableSystem) { | |
$command += " -writable-system" | |
} | |
if ($Detached) { | |
$command += " &" | |
} | |
Invoke-Expression $command | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment