如何更改 Genymotion 端口 [英] How to change Genymotion port

查看:32
本文介绍了如何更改 Genymotion 端口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想同时在不同的 Genymotion 设备上运行自动化测试.为此,我必须为每个设备提供单独的端口号.

I would like to run automatized test on different Genymotion devices in the same time. For this I have to give seperate port numbers for each device.

有可能吗?

推荐答案

从 Genymotion Launcher,您可以启动多个 VM.尽管它们都有相同的默认端口 (5555),但它们将从 VirtualBox 仅主机适配器获得不同的 IP 地址.例如,我刚刚启动了两台 Genymotion 机器,现在 adb devices 显示:

From the Genymotion Launcher, you are able to start multiple VMs. Although these each will have the same default port (5555), they will get different IP addresses from the VirtualBox host-only adapter. For example, I just launched two Genymotion machines and now adb devices shows:

$ adb devices
List of devices attached 
192.168.56.101:5555 device
192.168.56.102:5555 device
$

每个都可以通过在 TCP/IP 套接字程序中指定 IP 地址和端口来单独寻址,或者如果您正在执行手动命令行工作或编写脚本,则使用 adb -s.我不会在这里讨论套接字编程,但这里有一个使用 adb 选择性访问的快速示例,以查看位置服务是否在第二个设备上运行:

Each can be addressed separately by specifying IP address and port in your TCP/IP socket program, or by using adb -s if you're doing manual command line work or writing scripts. I won't go into socket programming here, but here's a quick example of selective access using adb to see if the Location service is running on the second device:

$ adb -s 192.168.56.102:5555 shell service check location
Service location: found
$

这篇关于如何更改 Genymotion 端口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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