3

On some devices, the binary /system/bin/ping seems to be removed. When I connect the device by USB and type

adb shell ping

it says:

/system/bin/sh: ping: not found

Is it possible to still send ping requests from such devices?
What are other alternatives to find out if a server is reachable or if packets get lost?

A.G.
  • 2,037
  • 4
  • 29
  • 40

1 Answers1

4

What's about InetAddress.isReachable() ? Doc:

Tries to reach this InetAddress. This method first tries to use ICMP (ICMP ECHO REQUEST), falling back to a TCP connection on port 7 (Echo) of the remote host.

Divers
  • 9,531
  • 7
  • 45
  • 88
  • 1
    This command doesn't always work. Seems to be a Java bug. http://stackoverflow.com/questions/9922543/why-does-inetaddress-isreachable-return-false-when-i-can-ping-the-ip-address – A.G. Jan 31 '14 at 10:19
  • **Resolved Date:2004-09-20** [Link on bug](http://bugs.java.com/bugdatabase/view_bug.do?bug_id=4921816) – Divers Jan 31 '14 at 10:22