Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse keeps starting new emulators

Tags:

I'm busy learning how to build apps for Android, and I come across a very awkward problem.

When I run my application (with the green circle with the play-icon in it), it starts an Android emulator (like it should), but the application doesn't start once the emulator is booted. When I click the run-button again, it tries to start a second android-emulator. In the console-tab it gives the following messages:

[2011-11-07 20:57:15 - ScrollView Demo] Android Launch! [2011-11-07 20:57:15 - ScrollView Demo] adb is running normally. [2011-11-07 20:57:15 - ScrollView Demo] Performing testapp.scrollviewdemo.MainActivity activity launch [2011-11-07 20:57:15 - ScrollView Demo] Automatic Target Mode: launching new emulator with compatible AVD 'Android_emulator' [2011-11-07 20:57:15 - ScrollView Demo] Launching a new emulator with Virtual Device 'Android_emulator' [2011-11-07 20:57:18 - Emulator] WARNING: Data partition already in use. Changes will not persist! [2011-11-07 20:57:18 - Emulator] WARNING: SD Card image already in use: C:\Users\Roy\.android\avd\Android_emulator.avd/sdcard.img [2011-11-07 20:57:18 - Emulator] WARNING: Cache partition already in use. Changes will not persist! 

It's like Eclipse doesn't recognize the emulators it starts... Weird thing is, sometimes it does recognize it, but most of the times it doesn't.

If it makes any difference: I'm running Eclipse IDE for Java Developers (Indigo Service Release 1) with ADT 15.0.0 on Win7 Home Premium 64bit

like image 734
user1020014 Avatar asked Nov 07 '11 20:11

user1020014


2 Answers

If the emulator has started, that may mean adb is acting up. Not sure on windows, but on mac/linux I do the following:

adb kill-server sudo adb devices 

You could try that (get rid of the 'sudo' business).

like image 66
Kevin Galligan Avatar answered Nov 15 '22 01:11

Kevin Galligan


I don't think you're waiting long enough. There's 3 stages to go through

  • Wait until the android logo disappears on startup (unless you've disabled boot animations)
  • Wait for the locked screen to come up.
  • Wait for the app to be actually installed onto the device (you'll get a message saying 'Installing nameOfApp on Emulator device #whatever')

This whole process will take anywhere from 3 - 15 minutes. To speed things up, make sure you leave the emulator ON then you just need to do step 3.

If you try to click Run again before this is all done, it will incorrectly assume no emulator is up and start up a new one.

You can also make sure your emulator is ok by selecting Window -> Android SDK and AVD Manager and selecting Virtual Devices. You can even start a device up first (stages 1 and 2) without actually installing your app. You can also check the status of the device using DDMS (and make sure that it isn't actually installing your app and then silently crashing) by selecting DDMS at the top-right of Eclipse or Window -> Open Perspective -> Other -> DDMS

Hope this helps.

like image 39
Dororo Avatar answered Nov 15 '22 01:11

Dororo