For me the problem was that currently Android Studio doesn't list older system images (older than 29) in the "Create Device" wizard, and that even if the relevant system images have been downloaded already.
The workaround I found was to download system images and create emulator devices from the command line. This works even if you don't have the Android Studio - you just need the Android SDK installed.
To download a system image, go into the directory where the Android SDK is installed (by default this is at ~/Android/SDK
on Linux), then in your terminal type: ./cmdline-tools/latest/bin/sdkmanager --list
- this will list all the available system images, even very old ones (I see the oldest SDK is 10). They should have the path (the text in the first column) labeled with this format: system-images;android-<sdk-version>;<type>;<architecture>
(there are also other stuff aside from system images, lets ignore these for now).
To download the system image you want, type ./cmdline-tools/latest/bin/sdkmanager --install "<path>"
where "<path>
" would be the first column from the available package list from the step above.
Then to create an emulator virtual device for this image, use the command line as well: type ./cmdline-tools/latest/bin/avdmanager create avd -d <device-type> -k '<system-image-path> -n '<device-name>'
, where:
- "
<device-type>
" would be the name of the device you want to emulate, for example "pixel_4a
" to emulate a Pixel 4a - use avdmanager list device
to get the list of devices.
- "
<system-image-path>
" would be the same path you used to download the system image, for example system-images;android-23;google_apis;x86_64
.
- "
<device-name>
" would be whatever name you want to be shown in Android Studio's "Device Manager" view.
For example: ./cmdline-tools/latest/bin/avdmanager create avd -d pixel_4a -k 'system-images;android-23;google_apis;x86_64' -n 'Pixel_4a_API_23'
If you had Android Studio running while doing all of that, you'd need to stop and restart it. If you want to copy the created files to another machine, you'd need to copy your entire Android SDK installation directory (or possibly only the "system-images
" folder inside the SDK installation directory) and also the content of the Android SDK AVD configuration directory - if you created any AVDs - this would be ~/.android/avd
under Linux.