Android Emulator slugish performance - android

I have intel i7 quad core with 4GB of ram but when I try to run my app on the emulator, God it takes a hell lot of time. Some times more than 5 minutes. I am not emulating any game or graphics intensive thing. I am learning android so just trying simple aps but still it is very slow. Moreover today I found this emulator has stop playing any music or sound I used the in the programs, I made previously. What can be the reason of this weird behaviour and slow speed.
How can I fix it? I am on Windows 7
PS: when I try to type in an app from user keyboard, the emulator doesn't take any input unless I use the emulator keyboard. Can I change its settings to take input from keyboard.
Regards

Open android sdk manager, in extras, install "Intel Hardware Accelerated Execution Manager", and use x86 images (there are two available, one 2.3.3, one 4.0.3) provided by intel.
On windows, android SDK Manager only downloads the installer of IntelHaxm, so you have to go in and install it yourself. Usually you can find it under
android-sdk\extras\intel\Hardware_Accelerated_Execution_Manager and install IntelHaxm.exe as admin.
4GB of RAM imho is not enough, windows 7 and eclipse together takes more than 2GB out on my system. 8GB is minimum and the more the better.

The emulator has always painfully slow for me; I've never gotten any of the standard speed suggestions to work. However, if you have a device available, testing directly on it is much, much faster.

Related

Emulator awfully slow on Windows 7

This is not a rant, and also not a duplicate of the forever "why is Android emulator so slow" problem. So, until a few weeks (maybe months) ago, emulating Android devices on my Win7 64-bit system was at the very least acceptable (x86 emulation was decently fast to be usable). However, trying to create any ("fast" "new" "2.0") emulator instances using the latest version of the SDK, platform tools, etc., is only a source of frustration and pain for several days now. I'm trying to understand if it's an issue on my side or people can actually use the latest version of the Android emulator included in the latest SDK, on Windows 7.
My PC config: Win7 x64 / Intel Core 2 Quad #3.8 GHz / 6 GB RAM / plenty of HDD space / dedicated GPU
What happens when trying to start an emulator with any API level, with either x86 or x86_64:
version 1) emulator starts, Android logo appears, glows for a bit, and that's it. It never reaches the Home screen. Emulator log shows absolutely no errors. Trying to connect using adb freezes Android Studio until I kill the emulator process.
version 2) Same like version 1, but in this case I can't even kill the qemu-system-i386 process (yes, not even with full admin rights). I have to actually restart Windows. Process remains a zombie, using 1 GB of RAM.
version 3) If I'm lucky, sometimes it reaches the Home screen, but becomes completely unusable. Sometimes I can click on things (maybe 2-3 clicks), and then becomes completely unresponsive. Occasional "Launcher has stopped" / "System has stopped" messages appear randomly in the emulator's home screen...
I've installed the latest Intel HAXM 6.0.3 version (the one downloaded by the Android SDK manager). Virtualization is enabled in BIOS.
I've tried all kinds of emulator options (more or less RAM, hardware vs software GPU, x86 / x86_64). Almost same result every time.
I've completely deleted and reinstalled the entire Android SDK and Android Studio.
CPU is not the issue - it's not under load while emulator runs.
Free RAM is not the issue - it's not fully used while emulator runs,
HDD is not the issue - I even defragmented it, and it's not looking like it's under any sort of load while emulator is running.
So, my question is very simple: is anyone out there using Windows 7, who can actually start up, let's say, a Marshmallow x86 emulator just by a simple 2-3 clicks process, and actually have it reach the home screen? Or does the "new, faster" emulator actually need some sort of super-powerful machine which I don't seem to possess anymore? The only thing that apparently changed was the HAXM driver. But it's stating that it has initialized just fine, so I don't know. Oh, and VirtualBox runs just fine. GenyMotion, by contrast, just flies. But I'd like to have the official Android emulator in a working state, or am I asking for too much?
Adrian, in my sad opinion: yes, you would need a powerfull processor, even a litle bit more of ram. The almost-aceptable scenario for you to run api 24 emulation in xxxhdpi resolution is an i7 with 8 of ram.
But this is what hard and software manufacturers want you for: upgrade, upgrade, upgrade. And it's not necessairilly true for you, or not obligatory for today. Maybe tomorrow...
It's my case too. I have a second generation i5 with 6 of ram and plenty of disk. Have a good geforce gpu too. And what I do to have my emulators running, or, how do I emulate in my win7? First of all: unninstalled all the last (about 30) non-security system updates from windows (! yes..., they make your system very heavy, the same with the various distributed c++ packages microsoft want us to carry on with our systems even if we use it once a year, or less - go to control panel and ripp'em off! Keep only the most recent c++ package - if you need it later, update again). Actually I'm even investigating what else "updates" I can delete from my system to have it usable again, mine again. Microsoft...
Second: enabling "power save mode" on your android studio (menu file), only in testing times, seems to make things faster.
Third: do heavy tests on emulators with "low" apis, like android 4 or 5 at max. And emulate devices with small screens or resolution, 5 pol. with 720 points (hor.), at max. If possible use _x86 64 emulation.
With this you can make it happen. The emulator is slow to load and open, but when running it works in a fairly good speed. First thing to do there: enter developer options and "force gpu" on both places. This will instruct your pc to take advantage of your dedicated gpu system.
Do not try to open two or more emulators at the same time, sorry.
When 90% of your debug is done (i do it in an emulator running android version lower than 5, normally 4.0 or 4.1 - 480x800 screen), then you pay the price to load a big screen, big dpi android 5, 6 or N). While it loads, make a coffee and use the bath.
When the beauty (beast?) is loaded, then do the final tests with all your apps that stayed waiting for this special moment. I maintain all my apps waiting for it. When I load the "big" emu I use this oportunity to do all tests I was needing - because it's not a simple task open this everytime I want.
In the future, as said: i7, 8ram, powerfull gpu and, very important: a good SSD drive (until 10x faster) to throw up damn nasty harddisk to the garbage. :) Best.
EDIT: when you create an AVD image with the latests APIs, Android Studio defines the ram and disk space values for the emulation and, in my opinions, these values are too big and too hard for the hostage computer to deal with. First point: your testing app never will demand all those resources. Two: your pc suffers hard to deal with a very fragmented Gb data from here to there, and there to here. Three: the virtual image created on your hard disk gets bigger with the use. So: 1 - lower the default values from your avd images, ram and disk sizes; 2 - on the avd launching window dialog, edit the options of each image and rip information everytime before start the emulation OR/AND 3 - uninstall your apps from the emu when not needed.

Emulator taking too long time to launch

Whenever I am trying to launch my emulator it launches but only the android logo is shown ,after waiting for many hrs also it does not work.
Device-3.2"QVGA(ADP2)320*480 (mdpi)
API Level-17
It's well known that the factory emulator is extremly slow. The trick here is that the factory emulator needs to run on an ARM machine, so it needs to convert the ARM calls to your your x86 (or 64 bits) processor calls. It's likely to never run fast at all. In this situation, you may want to trust on the factory x86 images that make use of Intel's HAXM drivers, not available to everyone, and I couldn't manage to make it work myself, but it's useful to know that.
However! Since a while ago, I started using Genymotion's emulators. They rely on an actual virtual machine, which is way way faster than anything a factory emulator could achieve. Even if I'm running it on the lowest Mac Mini out there, it's pretty smooth. I'd personally give it a try (well, precisely, I gave a try)
https://www.genymotion.com/
Try allocating more memory for it to use. The Android Emulator is super slow as it is, but if you are not giving it enough memory it has the ability to never load.
Google emulator uses ARM opcode, a kind of machine language. It must convert from ARM opcode to Intel opcode. That's why it's slow. The problem seems not to be RAM but CPU. Improving CPU will improve the emulator.
References to solve this issue:
Making the Android emulator run faster
If you are using your emulator in windows than you can use Microsoft Andriod Emulator.
Install microsoft android emulator in your windows os
If it is taking too much time in loading make sure you have installed the "HAXM installer" in SDK tools , Also make sure "Hyper V" option is also unchecked in "Turn Windows features on or off" in Control Panel --> Program and features.
Only After unchecking this feature you can install the HAXM installer.
After doing this the Emulator will not take time to load.
Try creating the Android virtual device with more RAM than usual. The usual is 1 GB. Even though I tried this on another lower end PC, it was still slow. I think it can be a problem with your hardware. Lower end hardware tends to have problems running emulators.
The problem seems not to be RAM but CPU. Improving CPU will improve the emulator.

How to decrease Eclipse AVD Load Time?

I am working on an android application, uing eclipse IDE. However it takes around 10-15 minutes to load my AVD and run the application.
My system Configuration:
RAM 8GB
intel Core2Duo Processor 2.53GHz.
OS: windows 7
Is their any alternative to increase our AVD's speed, without changing my systems hardware configurations.
You can setup an Android Virtual Machine using VirtualBox :
http://www.howtogeek.com/164570/how-to-install-android-in-virtualbox/
And to deploy to the virtual box :
android emulation on virtual box in eclipse
I tried this a while back and it was quite a performance improvement difference. I haven't done this in a while because I bought a pretty high end phone and I just use that now.
Is their any alternative to increase our AVD's speed
Using the x86 emulator will help.
That being said, your computer would appear to have issues. With that configuration, even the ARM emulator should take at most a minute or two, at least on Linux. Windows 7 perhaps adds some more overhead, but I would not expect it to be that much.
Also, bear in mind that you can usually keep your emulator open all day -- you do not have to exit and restart the emulator for most work.
GenyMotion have an Android Emulator that is pretty rapid. (not an AVD)
http://www.genymotion.com/
Genymotion is an emulator using x86 architecture virtualization,
making it much more efficient!
Taking advantage of OpenGL hardware acceleration, it allows you to
test your applications with amazing 3D performance.
It's free for personal use, has preconfigured devices (like N7 or Samsung GS3 etc).
I think you'll really like it.
You can select the snapshot options. On the first next start, a snapshot will be created. This will improve the launch speed of the emulator every other start...

Android SDK running slow

I have installed Android SDK on my computer. I have a intel i7-2600 processor and a Zotaxc 460 gtx fermi and 12 gb of ram. Basically saying, it shouldn't be running slow. Any suggestions on how to speed up the apis? or is it just slow?
Assuming you are referring to the Emulator and not Eclipse or something, you can speed up the Emulator a bit by choosing a smaller screen size for the virtual device, like HVGA instead of WVGA, etc. But that only goes so far. The emulator is just not very fast right now. They are working on it, however. I believe they show some of their early work in this Google I/O session.
If you mean the AVD (the android device emulator) is running slowly, then it is behaving as expected. Perhaps you have an android device you can plug in and run your app on? I would recommend you download developer drivers for whatever device your using instead of the bloated ones they try to get you to download.
Good luck.
Here is some usefull question that is about speed of android emulator:
Why is the Android emulator so slow? How can we speed up the Android emulator?
Eclipse performance can by improved by setting eclipse.ini. For example I have set -Xms512m
-Xmx2048m. Without this options, Eclipse has too few memory to open my project.
Disable the boot animation with -no-boot-anim, "Disabling the boot animation can speed the startup time for the emulator."

Android Emulator Alarm Clock Crashes

I am using the Android Emulator to debug my application, first off it is ridiculously slow, I mean like 15mins to load slow and on top of it, my Alarm Clock application fails?
Am I the only one, or do other people experience this? Is there a fix or will I just have to go cook steaks while the emulator is booting?
EDIT: I am running it on a Vista laptop, which as fixxed describe does not work well with the alarm clock failing, but I don't think it could be my laptop, its 2GB RAM Intel Dual CPU T2390 1.87GHz, its not even a year old. Could it be that I am creating new AVD's each time I run the emulator?
Anthony
You never mentioned what environment you're running in. Is it perhaps Vista? We had a discussion recently and it seems like the combination of the emulator and Vista just doesn't want to run well for some reason.
Either way something's definitely wrong. I have a laptop with a 2GHz Core2-Duo w/ 4GB RAM (rarely use more than 1.5) running Ubuntu 9.04 (32bit) and the emulator gets to a usable state in less than 30 seconds w/ Eclipse, Firefox, etc all eating more than their share of resources.
The very first time you launch the emulator on a new AVD, it will take a lot longer to start up, because it is creating copies of disk images and customizing them for the hardware parameters you specified.
Beyond that, you may need a faster PC. Android supplies an emulator -- you are running actual ARM opcodes in a virtualized phone. Converting and interpreting opcodes on the fly takes a fair bit of horsepower in terms of CPU and RAM, on top of any other tools you might use (e.g., Eclipse, which needs a ton of resources in its own right).
On a Pentium M 2.0 notebook with 2GB RAM and no Eclipse, in either XP or Linux, the emulator will start in maybe 90 seconds and will run tolerably well.
On a dual- or quad-core CPU with 2.5GHz or better speed, with 4GB RAM and no Eclipse, in either Vista or Linux, the emulator will start in under a minute and will run rather nicely.
I see the Alarm clock crashing problem in on Mac OS X 10.5 Leopard. 2.4 GHz , 4GB RAM.
My development environment is: Eclipse 3.4.2, Using Android 1.6 SDK
The emulator takes about 2 minutes for me to start up. I think even 2 minutes is too slow. The iPhone simulator takes only a few seconds.
Are you deleting the old avds that you have created?.....If not then it will slow up your computer as i tried it with different target machines......Is it necessary to create new avds every time you are trying to run the emulator?...If not i'll suggest you to stick with an avd(or delete the old ones).Hope this helps.

Categories

Resources