Created
August 31, 2018 18:50
-
-
Save mikehardy/e3702d4c46764d726475ee2058bb0f98 to your computer and use it in GitHub Desktop.
Android emulator fleet management - shutdown
This file contains hidden or 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
#!/bin/bash | |
# I was having trouble with ADB daemon startup, this hack seems to work though it's terrible | |
adb devices -l > /dev/null | |
sleep 2 | |
adb devices -l > /dev/null | |
sleep 2 | |
# Try the nice way | |
for EMU_ID in `adb devices -l | grep emulator | cut -d' ' -f1`; do | |
echo Stopping emulator $EMU_ID... | |
adb -s $EMU_ID emu kill | |
done | |
# This would be the brutal way | |
#for PID in `ps -eo pid,cmd,args |grep emulator|grep Android|grep -v bash|grep -v crash|grep -v grep|cut -d/ -f1`; do | |
# echo "Stopping emulator with $PID..." | |
# kill $PID | |
#done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment