31

With Android Studio's Android Emulator I'm seeing a problem displaying a complex WebGL-enabled graphics web page in a Java WebView widget (PixiJS demos appear blank in WebView on Android emulator). But I can only reproduce the problem with Android Emulator 27.1.12-4623001. It runs fine for my colleagues running Android Emulator 26.1.4-4266726.

How can I downgrade my Android Emulator from 27.1.12-4623001 to 26.1.4-4266726? I use Android Studio 3.0.1 (so does one of my colleagues though but her Android Studio still has Android Emulator 26.1.4-4266726. I'm also on Mac with High Sierra.

I looked on the Android Emulator Release Notes page but I don't see instructions on how to downgrade old versions. I did try downgrading Android Studio itself but even when I installed Android Studio 2.2.3, the emulator was still 27.1.12-4623001. I even deleted Android Studio 3.0.1 by following How to completely uninstall Android Studio?.

What version of the Android Emulator do I have?

Three methods:

  1. Launch the emulator, tap "..." on the right-hand side panel, click Help > About.
  2. Go to Android Studio > Preferences, search for "Android SDK", click "SDK Tools", and then scroll to Android Emulator.
  3. On Mac, go to Terminal and run ~/Library/Android/sdk/emulator/emulator -version
Michael Osofsky
  • 11,429
  • 16
  • 68
  • 113
  • Don't you think its a better idea to make it work with the current tools/emulators? Because if the problem is in the emulator, it may also be on devices. – Gabe Sechan Mar 05 '18 at 23:22
  • That's possible, of course, but seeing as how the emulator is supposed to emulate a particular Android API version, since the Android API version hasn't changed, it appears to be a problem isolated to the emulator. – Michael Osofsky Mar 05 '18 at 23:30
  • 1
    Do realize that since Android 5.0 the System WebView can be updated in the Play store so depending on specific emulator builds is limited at best. Also the emulator build may be dependent on SDK version (not the Intellij Android Studio version) – Morrison Chang Mar 05 '18 at 23:40

3 Answers3

29

Google support said I could download old Android Emulator versions as follows:

http://dl.google.com/android/repository/emulator-darwin-4266726.zip (for Mac) http://dl.google.com/android/repository/emulator-windows-4266726.zip http://dl.google.com/android/repository/emulator-linux-4266726.zip

Basically, just put the # (the one in major.minor.patch-#) along with darwin/windows/linux if you'd like to download any previous build.

To install on my Mac computer, I did as follows:

  1. Download http://dl.google.com/android/repository/emulator-darwin-4266726.zip via Chrome into ~/Downloads

  2. Backup the main emulator directory: mv ~/Library/Android/sdk/emulator ~/Downloads/emulator-backup

  3. Replace the main emulator directory: mv ~/Downloads/emulator ~/Library/Android/sdk/

  4. Copy the package.xml file from your previous emulator folder to the new folder, as per the comment by user mhsmith.

  5. Restart Android Studio

After that, the Android Emulator version was downgraded to 26.1.4-4266726.

Mr-IDE
  • 7,051
  • 1
  • 53
  • 59
Michael Osofsky
  • 11,429
  • 16
  • 68
  • 113
  • 6
    Where can you find the existing combinations of major.minor.path? – kriztho Sep 25 '18 at 02:16
  • @kriztho one source is the release notes page for the Android Emulator: https://developer.android.com/studio/releases/emulator – Michael Osofsky Sep 25 '18 at 21:30
  • But for instance... how do you know that 26.1.4 was equivalent to 4266726? That's the mapping that I'm having a hard time to grasp. – kriztho Oct 05 '18 at 05:37
  • I'm not sure if Google publishes a translation between Android emulator version number and Android emulator build number. If you want a particular Android emulator version number, I would just pick an old Android emulator build number and, following instructions 1-4 above to install it, run the Android emulator, go to extended controls for the Android emulator, click Help, click About, and look at the Emulator version, for example 26.1.4-4266726. That tells you the build number 4266726 corresponds to 26.1.4. That's the only way I can think of. – Michael Osofsky Oct 05 '18 at 18:19
  • I never thought of that. Sounds doable. I will give that a try. Thanks. – kriztho Oct 09 '18 at 13:50
  • 2
    @kriztho you and also get the mapping with $ANDROID_HOME/emulator/emulator -version – mmccabe Oct 10 '18 at 01:59
  • Michael, ic from the link u got it working. BTW: how did u contact google support? I'm trying to navigate the maze of dependencies between emulators, SDK's and system images for an integration test on travis – mmccabe Oct 10 '18 at 04:30
  • AFAIK, the emulator command has a dependency in the system images present. For example, here is a test on travis of the same emulator command (version 27.3.10) that works sometimes, and doesn't other times, depending on which system image is installed: travis-ci.org/mmcc007/test_emulators – mmccabe Oct 10 '18 at 04:33
  • 1
    @mmccabe here is where I contacted Google support https://issuetracker.google.com/issues/74175332. I am not sure if you'll be able to see the ticket when you login. But, in general, I think you can file tickets with Google at https://issuetracker.google.com – Michael Osofsky Oct 12 '18 at 16:13
  • @MichaelOsofsky how can I get this emulator release for windows 28.0.25 (March 29, 2019). I just cant figure out how you got those numbers. – Nux May 10 '19 at 13:49
  • @Nux did you see my comment https://stackoverflow.com/questions/49120854/how-to-downgrade-android-emulator/49284378?noredirect=1#comment92272319_49284378 – Michael Osofsky May 10 '19 at 17:32
  • @MichaelOsofsky I have read it several times but this statement " I would just pick an old Android emulator build number" confuses me. I just have the emulator I want to get rid off. So where I can get build number of the one I want 28.0.25. – Nux May 11 '19 at 10:12
  • 1
    @Nux You can download 28.0.25 here: https://dl.google.com/android/repository/emulator-windows-5395263.zip or here https://dl.google.com/android/repository/emulator-linux-5395263.zip – leiropi May 13 '19 at 07:47
  • @Nux I agree, my suggestion no longer makes sense. When I wrote it, maybe it was possible to see directory listing of https://dl.google.com/android/repository but it's not now. I think the only way might be to contact Google support. They responded to my inquiry within a week if I remember correctly. Another approach could be to search for the string "https://dl.google.com/android/repository/emulator" because someone else may know the build number. Or you could use a web scraper to test for every possible build number and download it. – Michael Osofsky May 13 '19 at 17:27
  • 1
    If you go to https://issuetracker.google.com and search for the desired version (e.g. "28.0.25", you'll probably find issue reports which contain the build number. – mhsmith Sep 18 '19 at 09:01
  • 7
    I had to preserve the existing `package.xml` as mentioned [here](https://issuetracker.google.com/issues/132587720#comment8). Otherwise, Android Studio refused to believe that the emulator was installed. – mhsmith Sep 18 '19 at 09:40
  • By the way downgrading to emulator v26 is the only way to run Android arm64v8 abi images on windows. Emulator v29 just crashes silently. – Anton Kukoba Dec 26 '19 at 13:00
  • 3
    30.5.3 stopped working on Mac OS Sierra. Link to 30.4.4: https://dl.google.com/android/repository/emulator-darwin_x64-7117093.zip – Matt Mar 22 '21 at 15:25
  • Precision on windows: - Download the old version from the link above - Backup the ..AppData\Local\Android\Sdk\emulator folder - Remove this folder - Unzip the folder downloaded, replace the breaking one - Add the old package.xml file. Without this it won't be recognized, and you will have "emulator is not installed" – Superdrac Dec 08 '21 at 12:02
  • all the links are dead see latest answer for new link – CaptainCrunch Mar 28 '23 at 18:49
6

For someone that still needing, this page contains all the versions and instructions:

https://developer.android.com/studio/emulator_archive

Jorge Vieira
  • 2,784
  • 3
  • 24
  • 34
5
  1. Download an older version of emulator from emulator-windows-5395263.zip and replace it with the existing emulator in ..AppData\Local\Android\Sdk\emulator.
  2. Restart the Android studio and in terminal run the following command emulator -avd avd_name -gpu mode, and this will initialize emulator. Mode can be host, guest.. etc For more clarification visit the following link
Emy Blacksmith
  • 755
  • 1
  • 8
  • 27
jin_wolf
  • 59
  • 1
  • 1