views:

3564

answers:

2

Hi, I am using the android emulator to run my programs. But its really slow. It takes around 90 seconds to startup and show the home screen. Can I tweak it so that I can reduce this time considerably? Thanks

+3  A: 

Hi, I was having a similar problem (thread here). However, mine was taking 10-15 mins. 90 seconds is blazing fast considering a lot of threads in the Android discussion groups. The emulator is slow by nature and the only recommendation I read was to keep the emulator open instead of closing it and rerunning it. However, as mentioned in my thread, if you have a physical Android device, you can just run it on that. It's what I'm doing at the moment and it was top-notch advice. No long waiting time. If you don't have a physical device, then I can only suggest you don't close the emulator between code changes, as the system will recognise the change.

keyboardP
Yeah exactly. Let the emulator run n rerun the code after editing.Its like hot swappable. Thanks
Bohemian
I didn't look at the link, but for my system I'm looking at times that are more like: first boot: 90sec, subsequent boot: 15-20sec boot. I'm not on blazing-fast hardware (laptop, 2ghz core2-duo, 4gig ram), Ubuntu... is it possible something else is slowing it down?
fiXedd
Leaving it running is very useful indeed. I personally switched to using the phone itself as the only debug tool. Just connect the cable, configure it and it runs immediately, no need to wait, plus supports orientation changes... Regards, Ari
BeMeCollective
@fiXedd: I'm not sure if there are that many ways to speed it up. Before I actually used a physical device, I was looking around for various ways to increase the speed of the emulator, but I couldn't really find much information on it. Even if there are a few minor changes you can make, I don't know how significant the speed up will be on current versions of the emulator.
keyboardP
You can't run different versions of the app on one device. How are you going to test 1.5 on a 2.1 device?
gcb
@gcb - I haven't done any Android programming lately, so I don't know if the emulators have been made faster lately. Still, if you have to test your program on a device you don't have, you don't really have any choice but to use the emulator. A good idea could be to get your program running to a decent level on your current phone, then use the emulator for the other versions.
keyboardP
+1  A: 

use those 3 options.

emulator -cpu-delay 0 -no-boot-anim -cache ./cache -avd avd_name

the first two are obvious. the third one will make the memory of the emulator kind of persistent. you can point it to any file that does not get destroyed by boot (such happens with /tmp) it's like a always-on hibernating device.

gcb