Ashok kumar Ganesan
Ashok kumar Ganesan

Reputation: 1128

How to configure the Genymotion emulator to the 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?

Upvotes: 1

Views: 7975

Answers (2)

Ashok kumar Ganesan
Ashok kumar Ganesan

Reputation: 1128

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");

    }

Upvotes: 1

Manuel Gatica
Manuel Gatica

Reputation: 1

Recently i i've used genymotion and appium and worked fine

1-i've installed appium(i've tried windows and console version succesfully)

2-i've installed genymotion and created a virtual device in it

3-launched virtual device from genymotion

4-in my test, when i defined driver capabilities, i didnt identified a specific virtual device, so, appium try to identify any active device(virtual or not)

try that and let me know if worked to help in anything i could

Upvotes: 0

Related Questions