adb shell ping

test the connection and latency between two network connection.

ping [-aAbBdDfhLnOqrRUvV] [-c count] [-i interval] [-I interface]
[-m mark] [-M pmtudisc_option] [-l preload] [-p pattern] [-Q tos]
[-s packetsize] [-S sndbuf] [-t ttl] [-T timestamp_option]
[-w deadline] [-W timeout] [hop1 ...] destination

STEP 1.

adb shell

STEP 2.

ping www.google.com
Notes: press Ctrl-C to stop ping
ping www.google.com -c 4