Network & Connectivity
Android 1.0+
Risk: READ_ONLY
Ping Network Host / Test Connectivity
Sends ICMP ECHO_REQUEST packets to network hosts to test internet connectivity and latency from the device.
Command Syntax
adb shell ping
Generic Syntax:
ping [-c <COUNT>] [-i <INTERVAL>] <host_or_ip>
Options & Parameters
| Flag | Description |
|---|---|
| -c <COUNT> | Stop after sending COUNT packets. |
| -i <SEC> | Interval in seconds between packets. |
Real-World Usage Examples
Ping Google DNS 4 times
Checks connectivity.
adb shell ping -c 4 8.8.8.8
Output:
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=118 time=14.2 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=118 time=13.8 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=118 time=14.5 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=118 time=13.9 ms
--- 8.8.8.8 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms