C:\Users\chengxiang.peng.QUNARSERVERS>adb connect 192.168.1.101:5555 connected to 192.168.1.101:5555 C:\Users\chengxiang.peng.QUNARSERVERS>adb devices List of devices attached 192.168.1.101:5555 device三、连接Wi-Fi
C:\Users\chengxiang.peng.QUNARSERVERS>adb shell am startservice \-n com.google.wifisetup/.WifiSetupService \-a WifiSetupService.Connect \-e ssid MERCURY_5CD00C\-e passphrase 30x30x30xx Starting service: Intent { act=WifiSetupService.Connect cmp=com.google.wifisetup/.WifiSetupService (has extras) }注意:由于我们必须先通过adb tools通过ip连接,才能通过adb shell am startservice启动Wi-Fi Service,所以在连接Wi-Fi前你还必须使用网线连接你的开发板;
C:\Users\chengxiang.peng.QUNARSERVERS>adb logcat | findstr "Wifi" ... ... //网络连接成功 01-01 00:13:56.412 1254 1254 V WifiWatcher: Network state changed to CONNECTED 01-01 00:13:56.414 1254 1254 V WifiWatcher: SSID changed: "MERCURY_5CD00C" 01-01 00:13:56.415 1254 1270 I WifiConfigurator: Successfully connected to MERCURY_5CD00C 01-01 00:13:56.484 408 456 D WifiNetworkAgent: NetworkAgent: Received signal strength thresholds: [] .... ... //保存连接历史,下次启动自动连接 01-01 00:14:08.190 408 1299 D WifiNetworkHistory: saving network history: "MERCURY_5CD00C"WPA_PSK gw: 00:25:86:5c:d0:0c Network Selection-status: NETWORK_SELECTION_ENABLED ephemeral=false choice:null link:0 status:2 nid:0 hasEverConnected: true 01-01 00:14:08.190 408 1299 V WifiNetworkHistory: writeKnownNetworkHistory write config "MERCURY_5CD00C"WPA_PSK ... ... 0:25:86:5c:d0:0c is in blacklist.3.我们尝试ping下百度,确认可以访问远程网络;
C:\Users\chengxiang.peng.QUNARSERVERS>adb shell ping www.baidu.com PING www.baidu.com (111.13.100.91) 56(84) bytes of data. 64 bytes from 111.13.100.91: icmp_seq=1 ttl=52 time=5.99 ms 64 bytes from 111.13.100.91: icmp_seq=2 ttl=52 time=5.72 ms四、树莓派3 I/O接口
https://developer.android.com/things/hardware/raspberrypi-io.html
原文:http://blog.csdn.net/p106786860/article/details/54566620