Why is the Android emulator so slow? How can we sp

2018-12-30 23:36发布

I have got a 2.67  GHz Celeron processor, and 1.21  GB of RAM on a x86 Windows XP Professional machine.

My understanding is that the Android Emulator should start fairly quickly on such a machine, but for me, it does not. I have followed all the instructions in setting up the IDE, SDKs, JDKs and such and have had some success in starting the emulator quickly, but that is very rare. How can I, if possible, fix this problem?

Even if it starts and loads the home screen, it is very sluggish. I have tried the Eclipse IDE in version 3.5 (Galileo) and 3.4 (Ganymede).

30条回答
怪性笑人.
2楼-- · 2018-12-31 00:12

Try Android x86. It's much faster than the Google Android emulator. Follow these steps:

  1. Install VirtualBox.
  2. Download the ISO file that you need.
  3. Create a virtual machine as Linux 2.6/Other Linux, 512 MB RAM, HD 2 GB. Network: PCnet-Fast III, attached to NAT. You can also use a bridged adapter, but you need a DHCP server in your environment.
  4. Install Android x86 on the emulator, run it.
  5. Press Alt+F1, type netcfg, remember the IP address, press Alt+F7.
  6. Run cmd on your Windows XP system, change the directory to your Android tools directory, type adb connect <virtual_machine_IP>.
  7. Start Eclipse, open the ADT plugin, find the device, and enjoy!
查看更多
君临天下
3楼-- · 2018-12-31 00:12

The startup of the emulator is very slow. The good thing is that you only need to start the emulator once. If the emulator is already running and you run your app again, the emulator reinstalls the app relatively quickly. Of course, if you want to know how fast it will run on a phone, it is best to test it on a real phone.

查看更多
后来的你喜欢了谁
4楼-- · 2018-12-31 00:13

IMPORTANT NOTE: Please first refer to the Intel list about VT to make sure your CPU supports Intel VT.

HAXM Speeds Up the Slow Android Emulator

HAXM stands for - "Intel Hardware Accelerated Execution Manager"

Currently, it supports only Intel® VT (Intel Virtualization Technology).

The Android emulator is based on QEMU. The interface between QEMU and the HAXM driver on the host system is designed to be vendor-agnostic.

HAXM

Steps for Configuring Your Android Development Environment for HAXM

  1. Update Eclipse: Make sure your Eclipse installation and the ADT plug-in are fully up-to-date.

  2. Update your Android Tools: After each Eclipse plug-in update, it is important to update your Android SDK Tools. To do this, launch the Android SDK Manager and update all the Android SDK components. To take advantage of HAXM, you must be on at least release version 17.

Enter image description here

  • Download the x86 Atom System Images and the Intel Hardware Accelerated Execution Manager Driver. Follow the image below:

Enter image description here

  • Install the HAXM Driver by running "IntelHaxm.exe". It will be located in one of the following locations:

    • C:\Program Files\Android\android-sdk\extras\intel\Hardware_Accelerated_Execution_Manager

    • C:\Users\<user>\adt-bundle-windows-x86_64\sdk\extras\intel\Hardware_Accelerated_Execution_Manager

    If the installer fails with the message that Intel VT must be turned on, you need to enable this in the BIOS. See the description for how to do this in Enabling Intel VT (Virtualization Technology) .

Install .exe or .dmg

  • Create a new x86 AVD: Follow the image below:

Create AVD

  • Or as for new SDK, Enter image description here
查看更多
君临天下
5楼-- · 2018-12-31 00:13

Here's what I noticed nobody mentioned it at all.

Assign all available processors to the emulator

Here's what you can try. It does speed up the emulator for me, especially during loading time. I noticed the emulator is only using a single core of the available CPU. I set it to use all available processors.

I'm using Windows 7.

When the Android emulator is starting, open up the Task Manager, look under the Process tab, look for "emulator-arm.exe" or "emulator-arm.exe *32"... Right click on it, select Processor Affinity and assign as much processor as you like to the emulator.

Enter image description here

查看更多
浅入江南
6楼-- · 2018-12-31 00:15

Update

You can now enable the Quick Boot option for Android Emulator. That will save emulator state, and it will start the emulator quickly on the next boot.

Click on Emulator edit button, then click Show Advanced Setting. Then enable Quick Boot like below screenshot.

Quick boot

Android Development Tools (ADT) 9.0.0 (or later) has a feature that allows you to save state of the AVD (emulator), and you can start your emulator instantly. You have to enable this feature while creating a new AVD or you can just create it later by editing the AVD.

Also I have increased the Device RAM Size to 1024 which results in a very fast emulator.

Refer to the given below screenshots for more information.

Creating a new AVD with the save snapshot feature.

Android emulator with save snapshot feature.

Launching the emulator from the snapshot.

Launching the emulator from the snapshot.

And for speeding up your emulator you can refer to Speed up your Android Emulator!:

查看更多
看风景的人
7楼-- · 2018-12-31 00:15

Intel released recommended installation instructions for the ICS emulator on May 15, 2012. This worked for me. The emulator is now fast and the UI is smooth.

The first half of the instructions are detailed enough, so I will assume you were able to install the Intel x86 Atom System Image(s) using the Android SDK manager, as well as Intel HAXM.

Now to ensure that everything else is set up so you can enjoy a highly performing emulator:

And start it:

sudo kextload -b com.intel.kext.intelhaxm (mac)

If HAXM is working properly, you may see this message when launching the emulator:

HAX is working and emulator runs in fast virtual mode

Otherwise, you may see this error:

HAX is not working and the emulator runs in emulation mode emulator:
Failed to open the hax module

  • Use GPU emulation. You cannot use the Snapshot option when using GPU emulation as of this writing. Ensure that GPU emulation is set to "yes".

  • Set the device memory to 1024  MB or more, but not more than the Intel HAXM setting. I use 1024  MB per device and 2048 for HAXM.

Always double-check the settings after saving! The emulator is very picky about what it allows you to set, and it will revert configurations without telling you.

With these settings the software keyboard no longer appears, nor do the on-screen back, menu, and recent keys. This appears to be a limitation of the current ICS Intel x86 system image. You will need to use the keyboard shortcuts.

On Mac OS you will need to hold fn + control for the F1 - F12 keys to work. Page up/down/left/right can be performed using control + arrow keys.

查看更多
登录 后发表回答