How to downgrade Android Emulator

2019-01-12 07:09发布

问题:

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

回答1:

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. Restart Android Studio

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