Create multiple Android emulator to run automation script parallel

Hello Team

I have to run my appium automation script on multiple emulator parallel.
I just want to know, is it possible to create multiple emulator on same time.

I f yes kindly let me know how to create it

Thanks in advance.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

Hi there @stephen.shinde! The method for starting up AVD is the same in Bitrise as it would be locally, with one small caveat – due to the flakiness of AVD in CI (not just on Bitrise but in any virtualized environment), we maintain a script for launching AVD that generally produces better results:

#!/usr/bin/env bash
# fail if any commands fails
set -e
# debug log
set -x
# write your script here
sudo $ANDROID_HOME/tools/bin/sdkmanager --update
$ANDROID_HOME/tools/bin/sdkmanager --install "emulator"
$ANDROID_HOME/tools/bin/sdkmanager --install "system-images;android-29;google_apis;x86"
echo "no" | $ANDROID_HOME/tools/bin/avdmanager --verbose create avd --force --name "pixel" --device "pixel" --package "system-images;android-29;google_apis;x86" --tag "google_apis" --abi "x86"
$ANDROID_HOME/emulator/emulator-headless @pixel -no-boot-anim -netdelay none -no-snapshot -wipe-data -verbose -show-kernel -no-audio -gpu swiftshader_indirect -no-snapshot &> /tmp/log.txt &
sleep 160

You can add this to your workflow using our script step, and you can merge your logic for starting multiple emulators into the script as well, and it should work.

You will probably have better luck running this on our Ubuntu LTS stacks than on our non-LTS stack, as less changes to package versions is likely to allow more stable emulator performance.

If you have any issues with the emulator once you’ve got things set up, please reach out to us using our on-site support channel as we will be better able to provide hands-on support. Thanks and good luck! :smile: