1

Here it goes.

There are two emulator instances say A and B on same machine that is connected to internet. Now I need to transfer a file between A and B. How do I do that ?

I writing a ftp might make sense .. but am not sure of how the ports and ips would be. are there any thing that Android supports for easy file transfer ? (Should work between emulators)

It would be great to know all the ways to do it.. Thanks

Dexters
  • 2,419
  • 6
  • 37
  • 57

1 Answers1

6

How to communicate between two Android emulators is explained in http://developer.android.com/guide/developing/devices/emulator.html:

Interconnecting Emulator Instances

To allow one emulator instance to communicate with another, you must set up the necessary network redirections as illustrated below.

Assume that your environment is

  • A is you development machine
  • B is your first emulator instance, running on A
  • C is your second emulator instance, running on A too

and you want to run a server on B, to which C will connect, here is how you could set it up:

  1. Set up the server on B, listening to 10.0.2.15:
  2. On B's console, set up a redirection from A:localhost: to B:10.0.2.15:
  3. On C, have the client connect to 10.0.2.2:

For example, if you wanted to run an HTTP server, you can select as 80 and as 8080:

  • B listens on 10.0.2.15:80
  • On B's console, issue redir add tcp:8080:80
  • C connects to 10.0.2.2:8080

Hope it helps!

Community
  • 1
  • 1
jcxavier
  • 2,232
  • 1
  • 15
  • 24
  • Yes. I figured it out and did this with some redir commands in telnet... Thanks anyways – Dexters Jan 07 '12 at 16:43
  • It'd be nice if I knew ***where*** to run these telnet ops. I feel like https://xkcd.com/979/ because I've looked at multiple answers, it's been 8 years and I still have no idea. Yay. – EpicPandaForce Jun 10 '19 at 00:46
  • I found out and documented here: https://stackoverflow.com/questions/4278037/communication-between-two-android-emulators – EpicPandaForce Sep 29 '21 at 21:11