Here are a hodgepodge of issues related to using the emulator.
The emulator takes forever to come up
Yes, yes it does, especially the first time you start it. It’s emulating booting up a complete OS running on a different architecture (ARM processor) than your development machine – so yeah, it’s a little slow. If you have an Android device you know that even running natively it’s not exactly an instant startup, so expect some delays in the emulator too.
Just go ahead and start the emulator when you start Eclipse and it’ll be there when you need it. Keep it running, there’s no need to stop and start it all the time.
Why does deploying a package to the emulator keep failing?
Often this is because you’re trying to deploy before the emulator has finished booting (because you waited until you were ready to try out your app before starting the emulator). The Home process needs to be running before a deploy will work. It’s a common n00b mistake to try the “run” button on Eclipse, watch it start an emulator and fail to deploy, kill the emulator, and try it again – it will never succeed until the emulator finishes booting.
Deploy may also fail for basically the same reason when the device bridge server has failed (see below) and Eclipse DDMS starts a new emulator (or tries to).
Of course, the other reason deploying may fail is if there’s something wrong with your package. Perhaps the API you’re developing against isn’t available on the emulator, or you’ve messed up something in the application manifest. But those problems should be fairly easy to diagnose from the error messages on the console.
I keep ending up with emulators that can’t be attached to
I’m not sure why this happens – something to do with networking (esp. during suspend/hibernate), or non-Sun Java JDK, or updating components while an emulator is running. But sometimes you’ll be running an emulator and it won’t show up in the list of emulators (either the command line adb devices or in the Eclipse DDMS perspective – or I’ve seen it show up in the perspective but without any processes).
Of course the simple remedy is to kill the emulator and start a new one, but as noted previously, that takes forever. The emulator is running – why can’t you connect to it?
Try using the “Reset adb” option from the DDMS Devices view menu, or restarting the server at the command line:
adb kill-server
adb start-server
Otherwise I don’t know what you can do. I have a question in about this and I’m waiting for an answer, too.
My emulator keeps offering to “force close” odd things, especially at startup
This is pretty common for me at least; you may never have seen it if you have better hardware. Just choose the “wait” option, everything will work out. I have a theory about this – perhaps someone who knows better will enlighten me if I’m wrong. Android has a policy of offering to force close non-responsive elements, where “non-responsive” means it hasn’t handled an event five seconds after it was notified of the event. As noted above, you’re running an emulator here, and it tends to run a bit slowly – but the clock is still ticking in realtime. I believe it’s simply a matter of certain parts of the operating system taking too long to respond, especially at boot time. Just ignore it and wait for them to finish.