Possible to safely run multiple Android emulators on the same machine and communicate using sockets?

Will Gillick picture Will Gillick · Nov 19, 2009 · Viewed 7.7k times · Source

I would like to simulate a small cluster of Android devices either on one laptop (worst-case), or on several machines on a private network. This is for testing communications and process migration on Android.

Is there a safe way to identify and launch a particular emulator from a given application under Eclipse? I have a recent Eclipse/Java/ADT setup and I'm using the a variety of tutorials from Mark Murphy, Meier, and Abelson.

Answer

Timothy Lee Russell picture Timothy Lee Russell · Nov 19, 2009

Running multiple emulator instances from the Android documentation states that you can run multiple instances concurrently.

How to create two or multiple instances of emulator on Windows or on Linux shows that instances can be created that are using different ports.

You can also start multiple emulators in Eclipse from the Device Management tab. The port number will be listed next to the name of the virtual device. For instance, my-emulator-name (emulator-5556).

I have not personally tried connecting to multiple instances running on different machines but it appears to be possible. The trick is to redirect requests to the host machine to the emulator. You can do this using "adb forward" or "redir add" from the console.

For more information, see Emulator Networking in the Android documentation.