Go from zero to Android emulator, automatically
Android Emulator Builder"Ideal for CI setup, automated testing, OS image creation, and other hands-off scenarios."
Getting Started
Using this application is easy. To get started using it:
- Edit the
config.sh
file to your liking - Run
./setup-all.sh
to set up the host and emulator - There is no step 3
Understanding the Configuration
The config.sh
file is the central point for configuring the behavior of the pipeline. Here is a table showing all of the properties you can change to adapt its behavior.
Parameter | Description | Type | Basic Config |
---|---|---|---|
androidSdkVersion |
Android SDK API level to apply to the emulator. See more at https://source.android.com/setup/start/build-numbers. | String | |
deviceProfile |
ID of the physical device whose hardware properties to emulate. See all supported devices by typing: avdmanager list device . Use the ID , not the Name when changing this value. |
String | ✅ |
emulatorDeviceName |
Any name you would like to call your emulator. | String | ✅ |
hostType |
Either mac or linux . Helps the script adapt for minor differences when running on either platform. |
String | |
includePlayStore |
Whether or not to include the Google Play store on the AVD. Works on API 24+ (x86) and API 28+ (x86_64). Please note that this framework assumes you are building on x86. See more information by typing: sdkmanager --list . |
Boolean | |
installDestination |
Directory to which all of the Android SDKs and tools are downloaded. Also sets $ANDROID_HOME . |
String | ✅ |
commandLineToolsDownloadUrlPattern |
Regex pattern used to extract the latest Command Line Tools from the Android Studio download page. | String | |
emulatorBootedSleepTime |
How long to wait, in seconds, after the emulator's boot has finished to ensure the launcher is visible and ready for user interaction. | Integer | |
jdkPattern |
Regex pattern used to identify the latest JDK 8 build available from SDKMan. | String | |
sdkManagerWaitTime |
How long to wait, in seconds, as commands to the sdkmanager are made. Useful for automatically accepting any licenses without hanging the process. |
Integer | |
startEmulatorTimeout |
How long to wait, in seconds, before assuming the Android Emulator will not or did not properly start. | Integer | ❌ |
Feel free to open the setup-emulator.sh
and setup-host.sh
files to see each of the steps which run, and enable or disable them according to your needs.
Host vs. Emulator
For the sake of clarity, this section defines the differences between a Host and an Emulator. You will see these terms sprinkled throughout the scripts and documentation.
- Host: Either a MacOS machine or a Linux machine. It is the bare metal on which the emulator itself runs, and the location to which all of the Android SDKs, the JDK, and Command Line Tools are installed.
- Emulator: The software which ships with the Android SDK which contains the virtual environment in which the Android OS runs.