Skip to content

Instantly share code, notes, and snippets.

@mdrokz
Created November 8, 2021 13:54
Show Gist options
  • Save mdrokz/44f0bb9a06c6ca1057a8abde0b3e37d4 to your computer and use it in GitHub Desktop.
Save mdrokz/44f0bb9a06c6ca1057a8abde0b3e37d4 to your computer and use it in GitHub Desktop.
FIsh function to start android emulator from terminal.
# Usage - start_emulator Pixel 5
function start_emulator
set emulator_list (~/Android/Sdk/emulator/emulator -list-avds)
for emulator in $emulator_list
set emulator_name (string split _ $emulator -f 1)
set emulator_version (string split _ $emulator -f 2)
if test $argv[1] = $emulator_name; and test $argv[2] = $emulator_version
~/Android/Sdk/emulator/emulator -avd $emulator
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment