无需路由器即可通过WiFi在真实设备和仿真器之间测试应用程序 [英] Testing app beetween real device and emulator via WiFi without router

查看:105
本文介绍了无需路由器即可通过WiFi在真实设备和仿真器之间测试应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发的应用程序包含一个客户端和一个服务器端,因此我需要测试它们之间的工作.我有一个真正的android设备,我希望android设备连接到模拟器.我有时在工作(当然,如果我有空的话)和在家工作.我家里有WiFi路由器,可以通过模拟器(在真实设备上运行的TCP侦听器)连接到真实设备,反之则不行(我不知道要使用哪个IP).但是在工作中,我只有热点WiFi点,而没有路由器.我的android设备连接正常.当adbWireless在设备上运行时,甚至更多的ADB可以连接到该设备.但这是行不通的,在任何情况下我都无法连接到tcp监听器.家庭和工作之间的区别是WiFi路由器的存在.有什么解决办法吗?如果不是,为什么Android debug bridge(ADB)可以连接到adbWireless?谢谢.

I develop app which contains a client and a server side, so I need to test work between them. I have a real android device and I want android device to connects to emulator. I'm working at work sometimes(if I have free time of course) and at home. I have the WiFi router at home and I can connect to the real device by emulator(TCP listener running on the real device), but not vise versa(I don't know which exactly IP to use). But at work I have only hot-spot WiFi point without router. My android device connects to it fine. Even more ADB can connect to the device when adbWireless running on it. But it doesn't work, I can't connect to tcp listener in any cases. The difference between home and work is existence of WiFi router. Are there any solutions? If not why Android debug bridge(ADB) can connect to adbWireless? Thanks.

推荐答案

我解决了这个问题.我在真实设备上运行网络共享,并在其上运行服务器.然后,我使用程序Connection state viewer进行链接: https://play.google.com/store/apps/details?id=ru.nolesh.android.connectionstateviewer 它可以帮助我找到IP地址.之后,我启动模拟器和客户端.因此,我通过给定的IP连接到服务器.

I solved the problem. I run tethering on my real device and run the server on it. Then I use a program Connection state viewer there is a link: https://play.google.com/store/apps/details?id=ru.nolesh.android.connectionstateviewer It helps me to find IP address. After that I start the emulator and the client side on it. So I connect to my server by given IP.

这篇关于无需路由器即可通过WiFi在真实设备和仿真器之间测试应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆