android与pc的连接
2016-09-05 10:20
239 查看
本篇总结android通过ssh连接到电脑linux系统,以及电脑连接到android的shell。目的是 整理相关工具方便今后使用
应用场景:连接pc 手机远程进入pc端工作 连接android 电脑wifi调试android
一、手机连接pc(前提pc端的linux已经安装ssh)
方法:手机上下载安装[Server auditor](http://download.csdn.net/detail/kernel_/9621751)或者其他ssh客户端connectBot等
Server auditor界面比较友好,可以随意改变字体 颜色
1.填写pc的linux系统的user ip password等信息
2.连接结果
二、pc连接android,root手机
方法1:adb连接 网上很多开源的wifi调试工具源码(也可以直接下载app)
stf源码:https://github.com/openstf/stf wifidebug源码:https://github.com/biglio23/WifiDebug adbWireless源码: https://github.com/Skywriter-se/adbWireless
以上是使用adb通信 ,步骤:
1.app程序打开并且开启服务 2.在cmd命令中: adb connect phone_ipaddress:portnumber
~~~~~~~~~~~~~~~
不使用上面的工具的情况:
cmd命令(配置tcp端口、连接)
adb kill-server #关闭adb服务 adb start-server #重启adb服务 adb tcpip 5555 #端口 adb connect xxx.xxx.xxx.xxx:5555 #连接
参考 http://www.cnblogs.com/rainduck/p/3577181.html
不依靠工具,自己在终端配置service.adb.tcp.port(使用上面的工具就可以省略这些步骤) TCP/IP配置: /#setprop service.adb.tcp.port 5555 #设置端口 /#stop adbd #关闭adb /#start adbd #重启adb 原来的usb配置: /#setprop service.adb.tcp.port -1 /#stop adbd /#start adbd
如下:android终端界面:
pc端
adb connect phone_ipaddress:portnumber(连接) adb disconnect phone_ipaddress:portnumber(关闭)
方法2:在手机安装ssh服务器工具
手机ssh服务器软件有QuickSSHd或SSHDroidpc上使用ssh客户端 如xshell等
步骤:
1.在手机上开启ssh服务,
2.得到root@192.168.1.113 3.pc上xshell建立连接 设置连接的用户名 密码 ip(SSHDroid设置的默认密码为admin)
4.结果:
现在得到shell。可以像linux系统一样输入命令控制手机(如同使用在手机安装的shell终端)
输入 logcat命令:
命令:http://blog.csdn.net/shuaihj/article/details/8889465?reload
相关文章推荐
- Android与PC的Socket(TCP/IP)通信(by USB) 拒绝连接的
- Android通过socket连接服务器(PC)
- android学习--手机连接到PC后程序不能检测手机的SDCard问题
- Ubuntu下Android手机通过USB连接PC方法
- 同一wifi下,android 模拟器(genymotion) 连接 PC成功 心得
- android手机连接PC后怎样切换为U 盘模式
- android通过.net连接远程pc数据库
- 如何让Android手机顺利连接上PC
- Android 真机连接本地PC服务器
- Android手机通过USB线连接PC共享上网
- android socket wifi 连接PC实现简单的PPT控制器
- android pc连接手机devices view下不显示设备的解决方法
- Ubuntu下Android手机通过USB连接PC方法
- android usb host 模式下开发 usb 口被device 占用如何连接PC查看logcat
- 如何让Android手机顺利连接上PC
- 【Android】模拟器连接本机PC的IP
- Android 真机连接本地PC服务器
- 仿豌豆荚实现android连接pc方法
- android usb host 模式下开发 usb 口被device 占用如何连接PC查看logcat
- Ubuntu下Android如何将手机通过USB连接PC开发测试