Skip to content

Instantly share code, notes, and snippets.

@shinayser
Created May 4, 2023 14:25
Show Gist options
  • Save shinayser/b4c55823bcea2b7bb07ff0c17ccb7f76 to your computer and use it in GitHub Desktop.
Save shinayser/b4c55823bcea2b7bb07ff0c17ccb7f76 to your computer and use it in GitHub Desktop.
Starts an Android Emulator (with completions)
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