Skip to content

Instantly share code, notes, and snippets.

@enzinier
Created March 5, 2017 02:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save enzinier/088b8d29b7ce4581091755fc69e391a4 to your computer and use it in GitHub Desktop.
Save enzinier/088b8d29b7ce4581091755fc69e391a4 to your computer and use it in GitHub Desktop.
Run only first device in android emulator.
#! /bin/bash
# only run first android emulator/
# ref. http://stackoverflow.com/questions/7837952/what-is-the-command-to-list-the-available-avdnames
# Check if the emulator command exists first
if ! type emulator > /dev/null; then
echo "emulator command not found"
exit 1
fi
# Gather emulators that exist on this computer
DEVICES=( $(emulator -list-avds 2>&1 ) )
# Run first device.
emulator @${DEVICES[0]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment