25

First of all, yes I know there's a lot of topics similar to this issue, I did use the search function on stack overflow.

But most of the issue that were brought up seems to about long boot times.

For me, the emulator is so slow, simply sliding from one home screen to another is like watching a slideshow. I placed in more 'RAM' into the virtual device but nothing changes.

How do I fix this?

I'm using a Macbook Pro 2010 on Mac OS X Lion.

lucas32
  • 251
  • 1
  • 3
  • 3
  • It's an emulator; it's going to be slow. – Dave Newton Oct 30 '11 at 17:08
  • Hmm the last time i used an emulator on a separate windows laptop it worked real smooth. – lucas32 Oct 30 '11 at 17:23
  • 1
    Windows != OSX, etc. Lots of differences. It's not RAM in the virtual device that would speed things up, it's emulator *program* settings that could make a difference, if possible. – Dave Newton Oct 30 '11 at 17:29
  • Better get used to it :) The emulator *is* really slow and needs a **lot** of CPU power. – JimmyB Oct 30 '11 at 18:12
  • The emulator is always slow.. Better debug on a real device. – Jong Oct 30 '11 at 19:30
  • How much ram you got in your macbook pro? I'm running on a late 2011 model with 8 gigs of ram and lion. Things are slow, but certainly not as much as you describe. – Code Poet Feb 04 '12 at 06:27
  • If it's the audio that's lagging, then that's faithful emulation: http://code.google.com/p/android/issues/detail?id=3434 badoom boom tish – Rhythmic Fistman Feb 04 '12 at 08:32
  • 1
    It can finally be virtualised using the official Android tools, it will run a native speeds even with GPU acceleration. http://stackoverflow.com/a/10754883/1031077 – Pedro Aug 20 '12 at 08:17

6 Answers6

49

On the latest version of the Android SDK there is support for x86 and native execution. Now it is possible to run the emulator at native speeds on a Mac but there is some work to do by hand.

First you need the latest SDK Tools rev.19+ and Platform tools rev.11+, the Android x86 Atom System Image for 4.0.3 to 4.4 and the Intel Hardware Accelerated Execution Manager (HAX) all this from the Android SDK Manager.

After this you need to install HAX, unfortunately the SDK Manager downloads an outdated version. There is the Intel-HAXM hotfix v1.0.8

When you create a new AVD to use this latest system image and enable the GPU support on it (at the moment the snapshot support are not compatible with GPU but it still worths it. The VM will boot up in just a few seconds anyway.

It considerably accelerates the development on Android, it is just a shame that it doesn't works like this out of the box.

Pedro
  • 1,171
  • 11
  • 7
  • I needed to restart Eclipse in order to have the CPU/ABI Intel Atom (x86) option. – SuperSkunk Mar 20 '13 at 13:44
  • I installed a nexus7 image, with stock options, and changed: resolution to: 13 inches, enabled HAX(w/ intel Atom x86 as CPU of course), and enabled host GPU. damn fast! A previous attempt on nexus10(with stock resolution) was VERY laggy & HEAVY! – Paschalis Jun 25 '13 at 11:20
  • As of now the SDK installs the current HAX version. BTW, this answer should be accepted! (Saludos de Victor MMS ;-) – momo Jul 08 '13 at 02:34
  • I got the 4.1.2 and 4.2.2 emulators to run quite snappy now, thanks to this answer. – jfroom Jul 12 '13 at 14:41
  • You saved me from thousand of hours spend for nothing ! – Alessio Dal Bianco Feb 05 '14 at 21:28
5

The bounty is still open incase anyone comes up with something better.

But so far, the only solution I've found for testing android on Mac OSX is to use a VM. You can still build/install your app from Eclipse as normal using ADT/abd

See http://software.intel.com/en-us/blogs/2011/10/11/getting-started-on-android-for-x86-step-by-step-guide-on-setting-up-android-2223-for-x86-testing-environment-in-oracle-virtualbox/ for step-by-step instructions.

asgeo1
  • 9,028
  • 6
  • 63
  • 85
3

Try genomotion emulator! Its very fast, and way lighter than the other simulators*!

  1. Go here https://cloud.genymotion.com/page/customer/edit/, and register
  2. Download the IntelliJ Idea/Android studio plugin, and the Application (works for Linux/Mac/Windows)
  3. Install the application. Install the plugin (Preferences/Plugins/Install from disc)
  4. Open application. Login with registration credentials. Download from genymotion's cloud an image (eg nexus7 w/o gapps)
  5. Select in IntelliJ/Android Studio the genymotion icon, and the select the path of the Application
    1. Run your app in genymotion emulator! Note: it will appear as "USB Device" and NOT as emulator!

*I have tried nexus7 w/ intels HAXM. Its super fast too, but its very heavy! Genymotion is much lighter!

Edit2: some weird error I faced using this emulator. When running the emulator, I could add text input to EditText if physical keyboard language was not english!

Paschalis
  • 11,929
  • 9
  • 52
  • 82
  • 2
    This Genymotion is really fast and makes me happy! Best tip I've found so far for my late 2009 MacMini running MountainLion-server. Thanks very much Paschalis! – iOS-Coder Oct 27 '13 at 22:31
  • At first it was slow but after using it for sometime it became very fast. Maybe it was doing some caching? Thank you so much for recommending this! – Zeyad Shaban Nov 15 '20 at 17:23
2

Some tips if you still want to try to use the default emulator:

1) Reduce screen size. Don't bother to build an emulator with 1280x800 screen, the emulator will choke on it as it only uses one CPU/process (not sure) to do all translation from ARM to MacOS and back again and does all of the screen rendering in software. I think the general recommendation is to stay with 800x480 or 1024x700. Less pixels = less lag. Heck try a 480x320, if its really bad on your machine.

2) If you can use an older version of the SDK like 1.6, do so. Some of the performance gets used up by the fancier home screens of Froyo and Gingerbread.

3) Allocate more memory to the emulator. If you are using eclipse: Go to Preferences. Select “Launch” ADD “-partition-size 1024” on the “Default emulator option” Click “Apply" You may have done this already but added for clarity.

[MC] Oops (3) was parition-size, -m is for memory.

Morrison Chang
  • 11,691
  • 3
  • 41
  • 77
  • I've been playing with other AVD/emulator settings. Using a Nexus-One AVD 800x480 with default settings and enabling the snapshot, decreased my boot/startup time from 8 minutes to 2 minutes. However the display updates are still terribly slow, especially device-rotation! Unfortunately I couldn't enable the 'Use host GPU' together with the 'Snapshot' feature. My setup: late 2009 MacMini, 4 GB-RAM 1067 MHz DDR3, 2.53 GHz Intel Core 2 Duo, NVIDIA GeForce 9400 256 MB, OSX 10.8.5 – iOS-Coder Oct 27 '13 at 22:44
  • @iOS-Coder If you check the emulator page http://developer.android.com/tools/devices/emulator.html you'll see that 'Snapshot' and 'GPU' are exclusive so you can only do one or other. 'Snapshot' is only good for restarting and normally I just leave the emulator running all day so I would choose 'GPU' over 'Snapshot'. Looks like you found Genymotion so good luck! – Morrison Chang Oct 27 '13 at 23:50
0

Solved Android Emulator laggy on my Macbook Pro changing to this options in Emulator Options (...) > Settings > Advanced:

enter image description here

Once applied, a cold boot on the emulator is required

0

Running an old Mac (Catalina) with latest Android Studio (flamingo 2022).

First, i tried some of latest virtual emulators such as Nexus 6 or 6p + android 13 operating system and they were too slow.

After trying punch of different ones, the following is working great.

Nexus 4,

ApI 24,

Operating system = Android 7(Nougat)

Graphics: Make sure to choose "hardware"

My resolution is 768X1280

The first boot is always slow, after that it should load reasonably fast. You should first go to device manager(android studio) and start the emulator, then go to your project and point to it and run it etc.

salah-1
  • 1,299
  • 11
  • 15