如何将Genymotion仿真器配置到应用程序? [英] How to configure the Genymotion emulator to the appium?

查看:247
本文介绍了如何将Genymotion仿真器配置到应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过日食我已经配置了Genymotion路径&我也下载了Genymotion中的虚拟设备。



在Appium中,下载的虚拟设备在启动设备下拉菜单中可见。然后我设置了apk路径&尝试启动Appium 1.3.4.1。



当时我收到一条错误消息,如

 启动节点服务器
用法:main.js [-h] [-v] [--shell]
main.js:错误:无法识别的参数:Nexus 5 - 4.4 .4 - API 19 - 1080x1920。
[--localizable-strings-dir LOCALIZABLESTRINGSDIR] [--app APP]
[--ipa IPA] [-U UDID] [-a ADDRESS] [-p PORT]
[ -c CALLBACKADDRESS] [-cp CALLBACKPORT] [-bp BOOTSTRAPPORT]
[-k] [-r BACKENDRETRIES] [--session-override] [--full-reset]
[--no-重置] [-l] [-lt LAUNCHTIMEOUT] [-g LOG]
[--log-level {info,info:debug,info:info,info:warn,info:error,warn,warn:debug ,警告:信息,警告:警告,警告:错误,错误,错误:调试错误:信息,错误:警告,错误:错误,调试,调试:调试,调试:信息,调试:警告,调试:错误}]
[--log-timestamp] [--local-timezone] [--log-no-colors]
[-G WEBHOOK] [--native-instruments-lib]
[ --app-pkg ANDROIDPACKAGE] [--app-activity ANDROIDACTIVITY]
[--app-wait-package ANDROIDWAITPACKAGE]
[--app-wait-activity ANDROIDWAITACTIVITY]
[ - android-coverage ANDROIDCOVERAGE] [--avd AVD]
[--avd-args AVDARGS]
[--device-ready-timeout ANDROIDDEVICEREADYTIMEOUT] [--safari]
[--device -name DEVICENAME] [--platform-name PLATFORMNAME]
[ - 平台版本PLATFORMVERSION]
[--automation-name AUTOMATIONNAME] [--browser-name BROWSERNAME]
[--default-device] [--force-iphone] [--force-ipad]
[ - 语言LANGUAGE] [--locale LOCALE]
[--calendar-format CALENDARFORMAT] [ - 方向ORIENTATION]
[--tracetemplate AUTOMATIONTRACETEMPLATEPATH] [--show-sim -log]
[--show-ios-log] [--nodeconfig NODECONFIG] [-ra ROBOTADDRESS]
[-rp ROBOTPORT] [--senendroid-port SELENDROIDPORT]
[ - -chromedriver-port CHROMEDRIVERPORT]
[--chromedriver-executable CHROMEDRIVEREXECUTABLE]
[--use-keystore] [--keystore-path KEYSTOREPATH]
[--keystore-password KEYSTOREPASSWORD] [ --key-alias KEYALIAS]
[--key-password KEYPASSWORD] [--show-config] [--no-perms-check]
[--command-timeout DEFAULTCOMMANDTIMEOUT] [ - keep-keychains]
[--strict-caps] [--isolate-sim-device] [--tmp TMPDIR]
[--trace-dir TRACEDIR] [--intent-action INTENTACTION]
[--intent-category INTENTCATEGORY] [--intent-flags INTENTFL AGS]
[--intent-args OPTIONALINTENTARGUMENTS]

节点服务器进程已结束

当我尝试使用Android SDK中的普通模拟器运行时,它的效果很好。
但是我想用Genymotion模拟器运行它。怎么做?我被困在这里。



我的问题是:


  1. 额外的模拟器可以在应用程序窗口中工作?

  2. 我需要在参数字段中给出什么?


解决方案

以下代码适用于上述问题。

  static String deviceName =Google Nexus 5  -  4.4.4  -  API 19  -  1080x1920; 

public static void main(String [] args)throws InterruptedException,ExecuteException,IOException {

DesiredCapabilities capabilities = new DesiredCapabilities();

DefaultExecutor executor = new DefaultExecutor();
DefaultExecuteResultHandler resultHandler = new DefaultExecuteResultHandler();

CommandLine launchEmul = new CommandLine(C:/ Program Files / Genymobile / Genymotion / player);
launchEmul.addArgument( - vm-name);
launchEmul.addArgument(\+ deviceName +\);
executor.setExitValue(1);
executor.execute(launchEmul,resultHandler);
Thread.sleep(40);

capabilities.setCapability(deviceName,Google Nexus 5 - 4.4.4 API 19 - 1080x1920);
capabilities.setCapability(platformVersion,4.3);
capabilities.setCapability(platformName,Android);
capabilities.setCapability(app,D:/SOFTWARES/Apks/GOA.apk);

driver = new AppiumDriver(新URL(http://127.0.0.1:4723/wd/hub),功能);
System.out.println(SetUp成功,Appium驱动程序启动成功);

}


Through eclipse I have configured the Genymotion path & also I have downloaded the virtual devices in the Genymotion.

In Appium, those downloaded virtual devices are visible in the"Launch Device" dropdown menu. Then I set the apk path & try to start the Appium 1.3.4.1.

By that time I am getting an error message like

Starting Node Server
usage: main.js [-h] [-v] [--shell]
main.js: error: Unrecognized arguments: Nexus 5 - 4.4.4 - API 19 - 1080x1920.
[--localizable-strings-dir LOCALIZABLESTRINGSDIR] [--app APP]
[--ipa IPA] [-U UDID] [-a ADDRESS] [-p PORT]
[-ca CALLBACKADDRESS] [-cp CALLBACKPORT] [-bp BOOTSTRAPPORT]
[-k] [-r BACKENDRETRIES] [--session-override] [--full-reset]
[--no-reset] [-l] [-lt LAUNCHTIMEOUT] [-g LOG]
[--log-level {info,info:debug,info:info,info:warn,info:error,warn,warn:debug,warn:info,warn:warn,warn:error,error,error:debug,error:info,error:warn,error:error,debug,debug:debug,debug:info,debug:warn,debug:error}]
[--log-timestamp] [--local-timezone] [--log-no-colors]
[-G WEBHOOK] [--native-instruments-lib]
[--app-pkg ANDROIDPACKAGE] [--app-activity ANDROIDACTIVITY]
[--app-wait-package ANDROIDWAITPACKAGE]
[--app-wait-activity ANDROIDWAITACTIVITY]
[--android-coverage ANDROIDCOVERAGE] [--avd AVD]
[--avd-args AVDARGS]
[--device-ready-timeout ANDROIDDEVICEREADYTIMEOUT] [--safari]
[--device-name DEVICENAME] [--platform-name PLATFORMNAME]
[--platform-version PLATFORMVERSION]
[--automation-name AUTOMATIONNAME] [--browser-name BROWSERNAME]
[--default-device] [--force-iphone] [--force-ipad]
[--language LANGUAGE] [--locale LOCALE]
[--calendar-format CALENDARFORMAT] [--orientation ORIENTATION]
[--tracetemplate AUTOMATIONTRACETEMPLATEPATH] [--show-sim-log]
[--show-ios-log] [--nodeconfig NODECONFIG] [-ra ROBOTADDRESS]
[-rp ROBOTPORT] [--selendroid-port SELENDROIDPORT]
[--chromedriver-port CHROMEDRIVERPORT]
[--chromedriver-executable CHROMEDRIVEREXECUTABLE]
[--use-keystore] [--keystore-path KEYSTOREPATH]
[--keystore-password KEYSTOREPASSWORD] [--key-alias KEYALIAS]
[--key-password KEYPASSWORD] [--show-config] [--no-perms-check]
[--command-timeout DEFAULTCOMMANDTIMEOUT] [--keep-keychains]
[--strict-caps] [--isolate-sim-device] [--tmp TMPDIR]
[--trace-dir TRACEDIR] [--intent-action INTENTACTION]
[--intent-category INTENTCATEGORY] [--intent-flags INTENTFLAGS]
[--intent-args OPTIONALINTENTARGUMENTS]

Node Server Process Ended

When I try to run with normal emulator in Android SDK it works well. But I want to run it with Genymotion emulator. How to do? I'm stuck up here.

My questions are:

  1. Whether the additional emulator will work in appium windows or not?
  2. What I need to give in the "Argument" field under appium?

解决方案

The following code works for the above question.

static String deviceName = "Google Nexus 5 - 4.4.4 - API 19 - 1080x1920";

    public static void main(String[] args) throws InterruptedException, ExecuteException, IOException {

        DesiredCapabilities capabilities = new DesiredCapabilities();

        DefaultExecutor executor = new DefaultExecutor();
        DefaultExecuteResultHandler resultHandler = new DefaultExecuteResultHandler();

        CommandLine launchEmul = new CommandLine("C:/Program Files/Genymobile/Genymotion/player");
        launchEmul.addArgument("--vm-name");
        launchEmul.addArgument("\""+deviceName+"\"");
        executor.setExitValue(1);
        executor.execute(launchEmul, resultHandler);
        Thread.sleep(40);

        capabilities.setCapability("deviceName","Google Nexus 5 - 4.4.4 API 19 - 1080x1920");   
        capabilities.setCapability("platformVersion", "4.3");
        capabilities.setCapability("platformName", "Android");
        capabilities.setCapability("app","D:/SOFTWARES/Apks/GOA.apk");

        driver = new AppiumDriver(new URL("http://127.0.0.1:4723/wd/hub"),capabilities);
        System.out.println("SetUp is successful and Appium Driver is launched successfully");

    }

这篇关于如何将Genymotion仿真器配置到应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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