[英]Launch an mobile app on emulator using appium
I wanted to launch my app in genemotion using Appium - Java. 我想使用Appium-Java在Genemotion中启动我的应用程序。
I can launch the app on real device, But I feel its better to use Emulators instead of real devices. 我可以在真实设备上启动该应用程序,但是我觉得最好使用模拟器而不是真实设备。 How I can do that ?
我该怎么做?
Just add a Virtual Emulator on Genemotion, make it up and running. 只需在Genemotion上添加一个虚拟模拟器,使其运行即可。 Then open your terminal and type: adb devices
然后打开您的终端并键入:adb devices
It will show, List of devices attached, make sure that new virtual device is running on some port. 它将显示“连接的设备列表”,确保新虚拟设备正在某个端口上运行。 ie : 192.168.56.101:5555 device
即:192.168.56.101:5555设备
Now use below use desired capabilities as below : 现在使用下面的方法使用所需的功能,如下所示:
DesiredCapabilities capabilities = new DesiredCapabilities(); DesiredCapabilities功能=新的DesiredCapabilities();
capabilities.setCapability("deviceName", "Name of the Emulator");
capabilities.setCapability("platformName", "Android");
driver = new AndroidDriver(new URL("http://0.0.0.0:4723/wd/hub"), capabilities);
It will launch the apk in genemotion. 它将以genemotion启动apk。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.