Skip to content

Instantly share code, notes, and snippets.

@royclarkson
Created May 1, 2014 16:14
Show Gist options
  • Save royclarkson/f39115fe0a7ac1f08630 to your computer and use it in GitHub Desktop.
Save royclarkson/f39115fe0a7ac1f08630 to your computer and use it in GitHub Desktop.
Bash script to kill all running Android emulators
#!/bin/bash
for ((PORT=5554; PORT<=5584; PORT+=2)); do
echo killing emulator-$PORT...
adb -s emulator-$PORT emu kill
done
@bwoodlt
Copy link

bwoodlt commented Aug 12, 2022

Another take:

#!/bin/bash
devices=`adb devices`

for device in $devices; do
    if [[ "$device" =~ "emulator-" ]]; then
      adb -s $device emu kill
      echo $device removed
    fi    
done    
echo "All Done."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment