I came across weird problem that I dont fully understand. I try to start more than 2 AVD from terminal. It works even for 4 AVDs but only on special conditions.
There is a code I use for 3 AVDs:
echo "no" | $ANDROID_HOME/tools/android create avd --name "Test-Emulator-API23-Nexus-5" --target "Google Inc.:Google APIs:23" --abi google_apis/x86_64 --device "Nexus 5" --skin "1080x1920"
echo "no" | $ANDROID_HOME/tools/android create avd --name "Test-Emulator-API23-Nexus-7" --target "Google Inc.:Google APIs:23" --abi google_apis/x86_64 --device "Nexus 7" --skin "1200x1920"
echo "no" | $ANDROID_HOME/tools/android create avd --name "Test-Emulator-API23-Nexus-10" --target "Google Inc.:Google APIs:23" --abi google_apis/x86_64 --device "Nexus 10" --skin "2560x1600"
$ANDROID_HOME/platform-tools/adb kill-server
$ANDROID_HOME/platform-tools/adb start-server
$ANDROID_HOME/tools/emulator -port 5556 -avd Test-Emulator-API23-Nexus-5 -gpu on &>/dev/null &
$ANDROID_HOME/tools/emulator -port 5558 -avd Test-Emulator-API23-Nexus-7 -gpu on &>/dev/null &
$ANDROID_HOME/tools/emulator -port 5560 -avd Test-Emulator-API23-Nexus-10 -gpu on &>/dev/null &
It works when I copy paste last 3 lanes which launches AVD to terminal AT ONCE. Then all 3 AVDs start at the same time and successfully launch. It also works for 4 AVDs.
It won't allow me to launch more than 2 AVDs if I try to do it sequentially. So I put 1st launch lane for Nexus-5. I wait until it boots completely. Then I put 2nd launch lane for Nexus-7 - it also boots successfully. And then if I try to launch more AVD I get freeze - black screen freeze on startup.
Any idea why this happens? Why can I launch many AVDs at the same time, but I can't start them one by one?