Increasing the Android SDK emulator speed - android

How do I increase the speed of the virtual device emulator in the Eclipse SDK for Android app development?
I have been searching all over the internet to find out how to speed this thing up, but I can't seem to find a fix that actually works for me.
Another problem I'm having is that I can't get the RAM above 1024MB.
Thanks for all the help. I have now fixed the speed. For anyone with the same problem, make sure this box is checked.
However, I still can't get my RAM above 1024 MB. What's the fix for that?

Method I've found which has worked on both my laptop and desktop that I use for development is when you create or edit the Android Emulator (AVD) there is an option near the bottom that says use Host GPU.
I've have found this to work on all Android versions
UPDATE
I missed the bit about the RAM problem. You haven't said if there is an error regarding the memory issue, but if you seeing failed to allocate memory: 8 then you need to modify the AVD config.
Go to C:\Users\your_name.android\avd\avd_name\config.ini and find hw.ramSize and make sure that MB is on the end of the number.

If you use an Android virtual device with Intel system image, you can enable HAXM(Hardware Accelerated Execution Manager) to speed up code execution. Take a look at this article: http://developer.android.com/tools/devices/emulator.html#acceleration

I would suggest to lower the resolution of the emulator to 320x480 and remove the skin of it (and learn the hotkeys).
If the hardware acceleration can work with your machine, try it. I've enabled it but never noticed any difference.
If that doesn't fit your needs, you can use other alternatives, which are faster, but have less features and I haven't tested them much:
VirtualBox together with androidx86 - only one I've tested and debugged an app on, but it was a long time ago.
Bluestacks - had lots of bugs, but seems promising.
WindowsAndroid - new, works, but I can't find out how to connect via adb.
Same as #1, but with androidvm instead of androidx86.
Genymotion - alternative emulator.

Try using Genymotion. I think that it would be a good choice. https://cloud.genymotion.com/page/customer/login/?next=/page/launchpad/download/

You can change it to least :
also :
and change the Screen coordinates from here :
note : in first step choose the Edit ,and the second step choose the start

Complete speed up android emulator sollution step by step cań be found also for beginners here:
Speeds Up the Slow Android Emulator
This sollution worked on my i3 machine very well. I have tested many sollutions and emulators for days, but this one is fastest and best for me.

Follow the following steps to make android emulation almost as fast as a real device.
Start the AVD Manager and create a new AVD with the Target value of Android 4.0.3 (API Level 15), revision 3 or higher (And choose the other settings like usual).
In Eclipse, click your Android project folder and then select Run > Run Configurations...
In the left panel of the Run Configurations dialog, select your Android project run configuration or create a new configuration.
Click the Target tab.
Select the AVD you created in the previous procedure.
In the Additional Emulator Command Line Options field, enter:
-gpu on
Run your Android project using this run configuration.
I have tried this and i confirm the result is a noticeably fast emulator (sometimes faster than a real device).
Ref - http://developer.android.com/tools/devices/emulator.html#acceleration

Related

Android SDK Emulator won't load

So i'm having awful trouble trying to get the Emulators in the Android SDK to start up. I can create the AVDs just fine, and then when hitting the 'start' button from the SDK Manager, bring up the small loading console window, indicating that the emulator is launching. However, after that, nothing happens!!
I have read many threads and posts with people having the same problem, maybe to do with the settings requiring too much memory, with some people waiting 30 minutes for the emulator to load!!
When trying to run the AVD emulator through terminal, I simply get a 'Bus Error' with no further indication of what could be going wrong...could it be a memory issue?
What I did to get where I am now:
Download the Android SDK package for Mac. I'm extracting the sdk only, not eclipse. I'm on Mac 10.6.8.
Install the SDK, and download the latest version of Android in the SDK Manager, along with default tools.
create a AVD and hit start.
window pops up to boot the emulator, that process is complete and window closes.
Nothing happens.
My knowledge of the sdk tools are very limited, all I want is to be able to do some testing...
Any help greatly appreciated!
Thanks
Actually, the simplest way to get emulators running right now is probably GenyMotion. They provide an interface, and pre-configured emulator images to make it pretty simple to get running.
This is not an endorsement (I use the standard ADT myself) but a lot of people find their tools useful.
Here is my suggestion: instead of using AVD, start using espresso and virtual remote android hardware emulator from Google servers - also known as android-test-kit. You will have the possibility to run and test you App on several different devices, without the need to spend money on actually all different devices for developing and testing purposes before releasing your Apps. You find further details here:
android-test-kit
Why Espresso
The 2 videos are somewhat long, but worth watching.
Taking this approach will solve your problem, save you money, and improve your productivity.
I run into the same issue on my mac 10.6 and it only works if i do
emulator64-x86 -avd my_android
Besides, my virtual device has to configured using x86 but not ARM
maybe this link can help you.

IntelliJ Idea - Android Virtual Device doesn't start

I'm using IntelliJ Idea 13 to develop Android applications on Ubuntu 12.04 64-bit. But my virtual device never starts despite there is no error.. its screen always stays like this:
My Android target level is 4.4 (API 19). How can I solve this issue?
Edit: Here is my AVD details:
I Recommend you look at this post to a similar question.
https://stackoverflow.com/a/5535532/2978914
they are using eclipse but you should be able to view the logcat, other posts say first load can be ridiculously long.
the spec of your PC may come into play as this post https://superuser.com/a/347298 explains the way the emulator converts to arm opcode: direct quote:
To use emulator more effectively, this is my experience:
Don't close emulator everytime you run your application.
Scale the emulator screen smaller.
Disable snapshot (Yes, it's useful but it takes time to close the emulator).
Specify a file path for SD card image file. I use only one SD card for many AVDs.
If you got any problems in adb, just reset adb, don't close emulator.
Open few programs in your operating sytem.
If you are using Windows, don't ever close emulator. Do it combined with Hibernate of Windows.
My AVD has started after I check "Use Host GPU" option from "Emulation Options".

Full queue, lose event in Android Emulator

I'm using the Android emulator running API version 15 from the SDK tools and in the console I'm getting this error:
[Date - Emulator] ##KBD: Full queue, lose event
I can't click on anything obviously. I googled it and the only solution is to delete the emulator and recreate it. This works for a while but then I have the same problem again.
Does anyone know what causes this error and how to fix it?
You can try the following to clear the old data and applications (your emulator will return to its default settings and data)
Tools --> Android --> AVD Manager
Then select your Emulator
From Actions column hit the arrow and select Wipe Data
I was facing same problem, There is Nothing RAM problem.
Solution is here's
Go to Tools -> AVD Manager ->Find the emulator which you are having this error -> Right click on your emulator and click on COLD BOOT NOW.
i probably figured it out. try this:
While creating the android virtual device, you must have given its size in KIBs or upto 32 mibs as shown in one of the tutorials on web.
now delete the previous device and make a new device giving its size as 512 MIB. It solved my problem.
Hope it'll work for you also, just give it a try.
I have ran into the same problem and I realized that I had dedicated only 256 MB of RAM for the virtual device. It had simply run out of memory.
Here's the solution:
-Go to Tools -> Android -> AVD Manager
-Find the emulator you are having this error on.
-Click to the "edit" button next to it. (In 3.0, this appears as a green pencil)
-Click "Show advanced settings"
-Scroll down and assign some more RAM to the device, 1GB should cut it, 2GB is definitely enough if you are running a simple app. I would also recommend assigning 512 MB of heap.
-Hit finish. Exit the emulator and restart it.
You should be good now, I hope it's been helpful. Happy coding!
this is a bug in android emulators. i also had the same problem. use 64bit linux for development to minimize such issues.
** freezing problem is there on 64-bit linux machines also, but the frequency of such problems is highly reduced. also emulators behave notably faster.
Sorry, I don't know whether this will help you... I had many problems when I try to run the emulator in Apple Mac mini. Whenever I run the emulator, machine asked me to restart. When contact Apple support, they told me it's a problem with less Memory. Just check and see how the memory is utilized by the emulator.
This is a common issue if you not provide enough resources to your virtual device or your virtual device is stuck some how.
Any one of these solutions should work
if you don't have anything useful in your virtual device, you can wipe it. by simply going to
Tools > Android > AVD Manager
Then select your virtual device
Right click select Wipe Data
Each time you start a virtual device it maintain state and pre installed apps in its memory so a cold boot will also be a good option.
to cold boot simple follow first two steps from above and select Cold Boot Now.
Now you are good to go!

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 uses 100% cpu even if nothing i running on it ?

I have a celeron processor :/ and android emulator on eclipse uses 100% of cpu and hangs everything unless I kill it . I was just trying a hello android program from a book and don`t know much about android or even eclipse .I have the android-eclipseplugin installled .
Can someone help me with is ?thanks!
As others have said, the solution is disabling sound. Unfortunately, in recent Android Studio releases (I'm using 1.4) the option to disable sound has been removed from the GUI. To disable sound you can do it either by launching the emulator from the command line with the -noaudio flag, or by editing the AVD's config file and setting the following parameters:
hw.audioInput=no
hw.audioOutput=no
On Linux, I found that file at ~/.android/avd/myAVD.avd/config.ini
I've had the exact same problem and found a solution that works for me.
In the config of the AVD I've set an extra flag "Audio playback support" to "no".
I've also made sure the AVD has 1GB of RAM.
This worked for me.
For me, it was unchecking the Multi-Core CPU check box
Niels' answer worked well for me https://stackoverflow.com/a/7706018
in that the emulator stopped using 100% CPU (dropped down to 10-15%)
Furthermore it had another useful "side effect". I noticed that playing video in Totem or music in RhythmBox would block while the emulator was running. VLC would play video but refuse to play the accompanying soundtrack for the video.
As soon as the emulator was killed, music would start playing.
Niels' answer to set "Audio playback support" to "no" prevents this issue.
I am running Ubuntu 11.04 and Android emulator version 13.0 (build_id OPENMASTER-172639).
I had same issue on my macOS High Sierra and for me helps to create new AVD device and choose CPU/ABI = x86_64, not x86 in Android version dialog. Hope that helps.
The Android emulator is emulating an ARM CPU without hardware acceleration which can be pretty slow even on a core2duo for example.
You can try to reduce the screen resolution of the virtual device which should result in a small performance increase.
The emulator is notoriously slow to start; it can take 15 minutes or longer on an underpowered machine. You can speed start-up a bit by passing the -no-boot-anim to the emulator start-up command. Other emulator options are described here. Also, some AVDs start faster than others. Try creating an AVD with the lowest level SDK that is useful for you.
Once the emulator has started, you don't need to shut it down. When an app exits (or crashes, or whatever), you can just run it again.
One alternative that worths mentioning is Genymotion. It's an android emulator based on VirtualBox, with pre-created images. It supports some features the stock Android emulator isn't very good at, like Wifi 3G, Bluetooth, GPS (with a fancy Google Maps integration, so you don't have to find coordinates manually), multiple screens, etc.
It worth giving it a try at http://www.genymotion.com/
I had this issue running the emulator on Ubuntu 14.04. Disabling the audio does bring down the CPU usage, but in case you need audio to work, it can be fixed by adding a symlink:
sudo ln -s /usr/lib/x86_64-linux-gnu/libpulse.so.0 /usr/lib/x86_64-linux-gnu/libpulse.so
The reason for this is that the emulator tries to use pulseaudio as the backend, but will be unable to link to libpulse.so, which does not exist on Ubuntu (unless you installed the libpulse-dev package). Then it will fall back to ALSA, which constantly calls poll, causing 100% CPU usage.
A fix for the emulator is coming, but for now, adding the symlink solves the issue.
I strongly recommend not to use android emulator. Use VirtualBox + android x86 OS (you can download it here ), and you will get real perfomance increase.
Unfortunately, as far as i remember, it is not from google and it supports only Android 2.2. I really do not understand, why google is not going to make simulator as fast as iPhone simulator , or to make official x86 release for debugging. I do not need emulating ARM processor instructions and I think 99% developers do no need it too.

Categories

Resources