问题描述
我想知道是否有可能两款Android模拟器之间的交际开始在两台不同的机器联网。
I wanted to know if it is possible the comunication between two Android Emulators started on two different machines networked.
例如
- 仿真器一台机器M1上运行
- 模拟器B关于机器运行M2
For example- Emulator A run on machine M1- Emulator B run on machine M2
灿A和B交换消息?
如果是的话,我用的IP地址?
If yes, what ip address do I use?
非常感谢你
德博拉
Thank you very muchDeborah
推荐答案
您可能已经知道这一点。由于Android的SDK-tools_r7它应该至少可以在两个仿真器连接到对方。无论是在物理机之间的作品是不是我知道。这也许可以建立两个主机之间伪装为这个特定的广播。
You might know this already. As of android-sdk-tools_r7 it should at least be possible to connect two emulators to each other. Whether is works between physical machines is not something I know. It might be possible to set up masquerading between the two hosts for this specific broadcast.
从Android
启用模拟器的互连
该补丁增加了-shared净id选项到模拟器哪些
联接在共享网络仿真器。
如果给出选项模拟器在启动时附加
绑定到多播套接字网络接口。该播套接字
模拟一个网络集线器,互连仿真器。
如果没有给出-shared网-id选项,没有什么变化。
This patch adds a -shared-net-id option to the emulator which joins the emulator in a shared network. If the option is given the emulator is started with an additional network interface bound to a multicast socket. This multicast socket emulates a network hub, interconnecting emulators. If the -shared-net-id option is not given, nothing changes.
要连接两个仿真器,使用 -shared网-ID<数过夜。然后,他们将直接分享一切发送或读取IP
10.1.2<一些方式>
在模拟器上
To connect two emulators, use the
-shared-net-id <number>
command line option when starting the emulator. They will then directly share everything sent to or read from ip 10.1.2.<number>
on the emulator.
另一种方法是利用亚行启用仿真器之间端口转发,然后设置为伪装的联网计算机的端口。
Another approach would be to enable port forwarding between the emulators using adb, and then set up masquerading for those ports on the networked machines.
我真的不知道这两个方案都符合,你以后问用例。如果没有,增加更多的细节,原来的问题可能会有帮助。 :)
I'm not really sure that either of these solutions match the use case that you're asking after. If not, adding more details to the original question might help. :)
免责声明:我没有尝试过的第一种方式,第二我只用确保仿真器可以绕过一个讨厌的企业防火墙和HTTP代理服务器,这样我们可以测试Android浏览器。该原则应该是声音虽然。
Disclaimer: I have not tried the first approach, and the second I've only used to make sure that an emulator could bypass a nasty corporate firewall and HTTP proxy so that we could test the android browser. The principle should be sound though.
更新:
不,我打了与它周围一大堆,没有发现很好的解决方案。我不是在iptables来建立这种方式,对服务器端的工作的有效隧道足够好了。
Update:Nope, I played around with it a whole lot and found no nice solutions. I am not good enough at iptables to set up a valid tunnel that way that works for the server end.
问候,结果
的Mikael
Regards,
Mikael
这篇关于Android的仿真器之间的通信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!