查詢連接的裝置
C:\eclipse4_64\android-sdk-windows\platform-tools>adb devices
List of devices attached
emulator-5554 deviceadb shell
指定一台下命令
C:\eclipse4_64\android-sdk-windows\platform-tools>adb -s emulator-5554 shell
root@android:/ #
查詢網路裝置
C:\eclipse4_64\android-sdk-windows\platform-tools>adb shell netcfg
lo UP 127.0.0.1/8 0x00000049 00:00:00:
00:00:00
eth0 UP 10.0.2.15/24 0x00001043 52:54:00:
12:34:56
sit0 DOWN 0.0.0.0/0 0x00000080 00:00:00:
00:00:00
查詢網路裝置設定
C:\eclipse4_64\android-sdk-windows\platform-tools>adb shell ifconfig eth0
eth0: ip 10.0.2.15 mask 255.255.255.0 flags [up broadcast running multicast]
測試網路
C:\eclipse4_64\android-sdk-windows\platform-tools>adb shell ping -c 3 localhost
PING localhost (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.310 ms
64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.616 ms
64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.338 ms
--- localhost ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2004ms
rtt min/avg/max/mdev = 0.310/0.421/0.616/0.139 ms
好像只能用在 localhost 127.0.0.1 10.0.2.2
發現採用 nc(netcat) 命令才可
C:\eclipse4_64\android-sdk-windows\platform-tools>adb shell nc -v www.google.com 80
Connection to www.google.com 80 port [tcp/www] succeeded!
C:\eclipse4_64\android-sdk-windows\platform-tools>adb shell nc -v 192.168.1.72 8080
Connection to 192.168.1.72 8080 port [tcp/webcache] succeeded!
沒有留言:
張貼留言