简体   繁体   English

可以用adb connect连接两部手机吗?

[英]Is that possible to connect two phones with adb connect?

I have a question about adb connection. 我有关于adb连接的问题。 In my case, I create a wifi hotpot in phone A, the phone B connect to this wifi and have a ip address. 在我的情况下,我在手机A中创建一个wifi火锅,手机B连接到这个wifi并有一个IP地址。 I want to establish a adb connection in phone A. But i encounter a error. 我想在手机A中建立一个adb连接但是我遇到了错误。 In my Phone A, I tried below command: stop adbd, start adbd, adb tcpip 5555, adb connec xxxx It always fails and report: unable to connect xxxx From shell windows, I can find the port-5038 is listenning. 在我的手机A中,我尝试了以下命令:停止adbd,启动adbd,adb tcpip 5555,adb connec xxxx它总是失败并报告:无法连接xxxx从shell窗口,我可以找到端口-5038正在收听。 ping from phone A is ok too. 从手机A ping也是可以的。 But it can not work and i don't know how to do it. 但它不能工作,我不知道该怎么做。 Anyone can help me about it. 任何人都可以帮助我。 Anyone has similar experience? 有没有类似的经历? thanks very much. 非常感谢。

Yes it's possible. 是的,这是可能的。 Please follow steps below: 请按照以下步骤操作:

  1. Start wifi hotspot of Phone A 启动电话A的wifi热点
  2. Connect Phone B by starting wifi 通过启动wifi连接电话B.
  3. Connect Phone A to PC 将电话A连接到PC
  4. Run adb tcpip 5555 运行adb tcpip 5555
  5. Disconnect Phone A from PC 断开电话A与PC的连接
  6. Connect Phone B to PC 将手机B连接到PC
  7. Run adb shell 运行adb shell
  8. Run adb connect "PhoneA's IP" 5555 运行adb connect "PhoneA's IP" 5555
  9. execute adb shell 执行adb shell

NOTE: If your phoneA is listening on 5555 port and you again start tcpip 5555 then PhoneB have problem to connect with PhoneA with 5555 port,I have encountered problem which you have by enabling tcpip 5555 session in phoneA 注意:如果您的phoneA正在侦听5555端口并且您再次启动tcpip 5555,那么PhoneB有问题与PhoneA和5555端口连接,我通过在phoneA中启用tcpip 5555会话遇到了问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM