[Android] [putty连接Android设备] [Android设备网络调试]


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连接了。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM