Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to specify port number on emulator?

I want to run two emulators simultaneously, one on port 5554, and one on 5556. The first one is already set; but how do I configure the second one to be on 5556 (in Elipse)?

like image 499
B. Clay Shannon-B. Crow Raven Avatar asked Nov 13 '11 04:11

B. Clay Shannon-B. Crow Raven


People also ask

How do I find my emulator port number?

Launch the dialer app on the originating emulator instance. As the number to dial, enter the console port number of the instance you'd like to call. You can determine the console port number of the target instance by checking its window title, where the console port number is reported as "Android Emulator (<port>).

What is emulator port?

The Android SDK includes an Android device emulator — a virtual device that runs on your computer. The Android Emulator lets you develop and test Android apps without using a physical device.


3 Answers

Change directory to android-sdk/tools

Issue the following command

./emulator -port 5556 -avd AVD2_1_HVGA

AVD2_1_HVGA is my AVD name in Eclipse. You can see your AVD name by selecting the menu Window > AVD Manager.

like image 141
wannik Avatar answered Oct 03 '22 06:10

wannik


Just put -port 5556 on the command line that launches the second emulator. You should be able to adjust the command line in the Launch Configuration panel.

like image 26
David Schwartz Avatar answered Oct 03 '22 07:10

David Schwartz


It seems if I start another AVD (NOT another Android app directly from Eclipse, which then naturally invokes an AVD), and THEN start the second app from Eclipse, and choose the just-invoked AVD to run it, it will automatically use 5556 (with the previously running Android app defaulting to using 5554). So: problem solved; it seems there is no need to go to a command line, it's simply a matter of doing things in a particular order.

like image 41
B. Clay Shannon-B. Crow Raven Avatar answered Oct 03 '22 06:10

B. Clay Shannon-B. Crow Raven