views:

524

answers:

2

Most of the idea is in the title, I just would like to know if it is possible to start 2 emulators at the same time with 2 different locale (to test the I18n of my app). If there was a way of doing it in Eclipse, that would be greater...

+1  A: 

If you click the Button for starting the emulator in Eclipse (the litlle mobile phone) Eclipse should open a dialog that lets you choose which android virtual device (AVD) you want to start. You can create a second AVD in this dialog and then start them both after each other.

Now you have to change the locale of one of the emulators to the wanted language. The emulator should save this settings so you have to configure this only once.

Janusz
yep I know that Janusz but as I'll 2 emu, which command am I suppose to use ? "adb shell" wil connect to which one?
Sephy
Good question I can't find something in the documentation to choose a specific emulator for adb
Janusz
Yeah I had some difficulty finding the right command but I finally got it :"adb -s emulator-5556 shell" to connect to the emulator and then the property command : "setprop persist.sys.language en;setprop persist.sys.country US;stop;sleep 5;start" for english for instance
Sephy
See also my question (and solution) about automatically setting the emulator language in advance: http://stackoverflow.com/questions/2417427/changing-the-android-emulator-locale-automatically
Christopher
A: 

In Eclipse, this is easy to do. Use the Android Virtual Device (AVD) manager to set up as many emulators as you want. Depending on whether you've updated to the latest version of the Eclipse plug-in, the button to launch the AVD manager will either be a black phone or the Android Robot's head above a black square with an arrow in it. Either way it's in the toolbar near the shortcuts for Save, Print, etc.

In the AVD you can create various emulators with different Android versions (download other SDKs in the 'Available Packages' menu in the left). Once you've created the emulators, start them with the button on the right. You can have multiple emulators running at the same time if you want. The emulators have a program installed on them already called 'Custom Locale' that lets you change their location information. You can't do this while creating the emulators, but it's saved when you do in the emulator so you don't need to do it every time.

After that, to choose which emulator your program will run on, change its run configuration Target to manual. This is done by clicking on the more options arrow next to the green 'Start Program' button, selecting Run Configurations, the Target tab, then selecting manual. You can also do this by right clicking on your project in the project browser (list on the left), and the option is under 'Run As' -> Run Configurations.

Steve H
How can I set Eclipse so it should use the previous conf. each time when I hit those buttons?
Pentium10
What configuration are you asking about? The emulator saves the locale you set automatically.
Steve H
I've seen a while ago a blog post, that you can tell Eclipse to launch the previous configuration without raising the window to ask you. But unfortunately I lost the blog's address. # Whenever I want to Debug a project, after I hit the icon, I am prompted which conf. I do want to run. Or I have to use the icon's drop down menu to launch a preset conf. Since you posted so much about the conf section, I was wondering if you might know the answer for this setup.
Pentium10
Unfortunately no, I'm not sure how to solve that. Sometimes Eclipse gives the list of "Run as ..." options, sometimes it knows it's an Android activity. What might work for you is if you go in the run configurations, and select a specific Android version to run on rather than leaving it to automatically decide. That might help, but I'm not sure.
Steve H
I found the post here: http://bit.ly/cRtDHP it's the 2nd image
Pentium10
Aha! Well found.
Steve H