1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | file: system /core/adb/adb.c line: 921 /* for the device, start the usb transport if the ** android usb device exists and "service.adb.tcp" ** is not set, otherwise start the network transport. */ property_get( "service.adb.tcp.port" , value, "0" ); if ( sscanf (value, "%d" , &port) == 1 && port > 0) { // listen on TCP port specified by service.adb.tcp.port property local_init(port); } else if (access( "/dev/android_adb" , F_OK) == 0) { // listen on USB usb_init(); } else { // listen on default port local_init(ADB_LOCAL_TRANSPORT_PORT); } |
根据上面的代码, 执行以下命令
stop adbd
setprop service.adb.tcp.port 5555
start adbd
便能开启网络调试的端口,PC端执行
adb connect <host>[:<prot>]
即可使用tcp协议连接Andorid设备。
putty连接Android设备
Android设备需要安装一个SSH Server软件,建议SSHDroid,https://apkpure.com/cn/sshdroid/berserker.android.apps.sshdroid
然后就可以通过putty连接了。
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· [.NET]调用本地 Deepseek 模型
· 一个费力不讨好的项目,让我损失了近一半的绩效!
· .NET Core 托管堆内存泄露/CPU异常的常见思路
· PostgreSQL 和 SQL Server 在统计信息维护中的关键差异
· C++代码改造为UTF-8编码问题的总结
· 实操Deepseek接入个人知识库
· CSnakes vs Python.NET:高效嵌入与灵活互通的跨语言方案对比
· 【.NET】调用本地 Deepseek 模型
· Plotly.NET 一个为 .NET 打造的强大开源交互式图表库
· 上周热点回顾(2.17-2.23)