Skip to content

Instantly share code, notes, and snippets.

@jrodbx
Created February 3, 2017 11:07
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 jrodbx/2ed09360146a34564efc20ad5de71e1f to your computer and use it in GitHub Desktop.
Save jrodbx/2ed09360146a34564efc20ad5de71e1f to your computer and use it in GitHub Desktop.
Genymotion Emulator Starter
#!/bin/bash
GMTOOL=/Applications/Genymotion.app/Contents/MacOS/gmtool
UUIDS=()
NAMES=()
INDEX=0
while read -r line; do
UUIDS[${#UUIDS[@]}]=$(echo -n $line | cut -f1 -d'|')
NAME=$(echo -n $line | cut -f2 -d'|')
NAMES[${#NAMES[@]}]=$NAME
if [[ $# -eq 0 ]] ; then
((INDEX++))
echo "$INDEX) $NAME"
fi
done < <($GMTOOL admin list | sed 1,2d | cut -c28-64,66-)
if [[ $# -eq 0 ]] ; then
echo -en "\nSelect emulator: "
read EMULATOR
else
EMULATOR=$1
fi
((EMULATOR--))
echo "Starting \"${NAMES[$EMULATOR]}\""
$GMTOOL admin start "${UUIDS[$EMULATOR]}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment