8,460
个编辑
更改
→使用网络连接adb调试
=== 使用网络连接adb调试 ===
{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''使用网络adb无需USB Typc C接口的数据线来连接电脑和开发板,而是通过网络来通信,所以首先请确保开发板的有线或者无线网络已经连接好了,然后获取开发板的IP地址,后面要用到。'''</big>|}
<ol style="list-style-type: decimal;">
<li><p>确保Android系统的'''service.adb.tcp.port'''设置为5555端口号</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>apollo-p2:/ # '''getprop | grep "adb.tcp"'''</p>
<p>[service.adb.tcp.port]: [5555]</p>|}</li><li><p>如果'''service.adb.tcp.port'''没有设置,可以在串口中使用下面的命令设置网络adb的端口号</p></li><{| class="wikitable" style="width:800px;" |-| apollo-p2:/ol># '''setprop service.adb.tcp.port 5555'''
apollo-p2:/ # '''stop adbd'''
apollo-p2:/ # '''start adbd'''
|}</ol>
<ol start="3" style="list-style-type: decimal;">
<li><p>在Ubuntu PC上安装adb工具</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>test@test:~$ '''sudo apt-get update'''</p>
<p>test@test:~$ '''sudo apt-get install -y adb'''</p>|}</li>
<li><p>然后在Ubuntu PC上连接网络adb</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>test@test:~$ '''adb connect 192.168.1.xxx:5555''' '''(需要修改为开发板的IP地址)'''</p>
<p>* daemon not running; starting now at tcp:5037</p>
<p>test@test:~$ '''adb devices'''</p>
<p>List of devices attached</p>
<p>192.168.1.xxx:5555 device</p>|}</li><li><p>然后在Ubuntu PC上通过adb shell就可以登录android系统</p></li></ol>{| class="wikitable" style="width:800px;" |-|
test@test:~$ '''adb shell'''
apollo-p2:/ #
|}
</ol>
=== 使用数据线连接adb调试 ===