Tsunaze
Tsunaze

Reputation: 3254

why eclipse open another emulator?

Why does Eclipse open an new emulator while there is already an emulator opened ? Sometime it happens, sometime it's not. Does someone knows why ? I hate when it doesn't that and i would like to fix this "problem"

Upvotes: 6

Views: 2603

Answers (5)

TryTryAgain
TryTryAgain

Reputation: 7820

This is caused when your project properties are not setup to run manually and for whatever reason (SDK or Target version) the emulator opens in a new instance.

To Solve: Right Click your Project --> Run As --> Run Configurations

Then, make sure the Project in question is the one selected on the left and the Name is on the top.

You will then see 'Target' at the top: enter image description here

Choosing Manual should allow you to choose the running emulator. If not, make sure your project SDK is set with an SDK version you have installed or a range that is compliant:

<uses-sdk android:minSdkVersion="3" />
<uses-sdk android:targetSdkVersion="14" />

or whatever range you plan on supporting and AVDs/Emulators you have setup.

Hope that helps!

Upvotes: 9

Akhil
Akhil

Reputation: 14038

I have faced this annoying thing many times, it happens occasionally. and I think I know the way to correct it. I think what happens is that the adb's connection with the emulator breaks or becomes faulty, so android launches a new emulator although you have already an existing emulator for the same platform running. To correct this problem. Go to DDMS-->Devices Tab-->Click the option "Reset adb" (which is the last option) . You will then see some error report in the console, but after a minute your emulator would be ready to be used without problems. I do it all the time and it works.

Upvotes: 0

user658042
user658042

Reputation:

Usually this happens because of two things:

adb crashed

Yeah that happens, adb crashes in some way and loses track of devices/emulators. In this case close the second emulator and restart adb, e.g. via the ddms app or on the command line by using adb kill-server followed by adb start-server. Then relaunch and it should be fine.

You try to launch an app with a higher/different api than the emulator

If you run a 3.0 app and you have an 2.3. emulator open, the plugin will start a higher api level emulator for you. Or if you need the Google APIs and the emulator doesn't have them, the same thing will happen. Sometimes you get a dialog to select what you'd like to do, but not always. Not sure when that happens exactly actually.

Upvotes: 0

kabuko
kabuko

Reputation: 36302

Yeah, it's annoying. I don't know how to fix it per se either, but instead I set it to always let me manually select the device to debug on. Then at least you can choose the correct device/emulator. Right click your project, select Run, Run configurations..., then select the Target tab. Change the Deployment Target Selection Mode to manual. Automatic with a selected device is supposed to work, but I find once in a while it'll launch something else. If that's not set you can try that and see if it works for you.

Upvotes: 1

Padma Kumar
Padma Kumar

Reputation: 20041

its according to your project.

if you are running normal AVD and you are trying to run google api project then it will automatically open the google avd that its suits.

and also your api level.

if your project is 2.3 and you are running android 2.1 API then its will try to open 2.3 avd from your AVD list.

Upvotes: 0

Related Questions