How to ping host computer from adb shell

5223 views
Skip to first unread message

Wink Saville

unread,
Jan 14, 2008, 5:46:13 PM1/14/08
to android-d...@googlegroups.com
Hello,

Actually, my long term goal is to extend my asynchronous messaging
which now works inter/intra processes on an Android device to work
inter-device. So what I really want to do is connect two Android Emulators
via TCP.

It would seem the first step is to ping from the emulator to the host
computer and that fails:

# ping 192.168.0.133
PING 192.168.0.133 (192.168.0.133): 56 data bytes

--- 192.168.0.133 ping statistics ---
9 packets transmitted, 0 packets received, 100% packet loss


After waiting for a few seconds I hit control C and get the
100% packet loss message.

Has anyone succeeded in either connecting two Android Emulators
via TCP or even pinging between an Emulator and the host?


Cheers,

Wink Saville

sombatsombat

unread,
Jan 15, 2008, 9:51:07 AM1/15/08
to Android Developers
I haven't successfully connect two Android-Emu together.
But I did can connect one app in Android-Emu to another Java app
(running on the same machine, typically Linux) using socket.
What I recommend is that you can use the tools 'adb' to forward a port
on localhost to a port in Android-Emu.

Digit

unread,
Jan 15, 2008, 5:59:32 PM1/15/08
to android-d...@googlegroups.com
this is a known limitation of the QEMU user-mode network stack. Quoting from the original doc:

Note that ping is not supported reliably to the internet as it would require root privileges. It means you can only ping the local router (10.0.2.2).

however, you can perfectly connect through TCP and UDP to the host computer.

On Jan 14, 2008 11:46 PM, Wink Saville < wi...@saville.com> wrote:

Hello,

Actually, my long term goal is to extend my asynchronous messaging
which now works inter/intra processes on an Android device to work
inter-device. So what I really want to do is connect two Android Emulators
via TCP.

It would seem the first step is to ping from the emulator to the host
computer and that fails:

   # ping 192.168.0.133
   PING 192.168.0.133 ( 192.168.0.133): 56 data bytes

Wink Saville

unread,
Jan 15, 2008, 7:20:09 PM1/15/08
to android-d...@googlegroups.com
Digit wrote:
> this is a known limitation of the QEMU user-mode network stack.
> Quoting from the original doc:
>
> Note that |ping| is not supported reliably to the internet as it would
> require root privileges. It means you can only ping the local router
> (10.0.2.2 <http://10.0.2.2>).
>
Thanks.

> however, you can perfectly connect through TCP and UDP to the host
> computer.
>
Yes, I've successfully done that. But my goal is A<->A (peer to peer)
one solution
is to create a proxy (A <-> proxy <-> A) such as Josh used here
(http://groups.google.com/group/android-developers/browse_frm/thread/b4fc2a71fa377baf/fb4d4b66e2bf8e3a#fb4d4b66e2bf8e3a)
But what I really want to do is to have a server running on one Android
and a
Client on another and for them to connect directly.

You mentioned in by "Bug: Emulator/Qemu ..." post that I can use eth1,
will this
work, i.e. have you tried it. As you can see, (Two emulator's
communication) I'm not
the only person that wants to do A2A.

If possible, could you post a little more instructions on a solution to
A2A, I will try
your eth1 suggestion and I really appreciate the help.

Cheers,

Wink


Reply all
Reply to author
Forward
0 new messages