问题描述:

Trying to launch the third party emulator Genymotion via Appium 1.3.4.1. But it fails.

I have done the following things.

I disable the Launch AVD from appium and launching the Genymotion AVD through the code.

I paste the overall code here:

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

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

DesiredCapabilities capabilities = new DesiredCapabilities();

capabilities.setCapability(CapabilityType.BROWSER_NAME, "");

capabilities.setCapability("deviceName","Google Nexus 5 - 4.4.4 - API 19 - 1080x1920");

capabilities.setCapability("platformVersion", "4.4.4");

capabilities.setCapability("platformName", "Android");

capabilities.setCapability("app","D:/SOFTWARES/Apks/Hybrid.apk");

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

driver = new AppiumDriver(new URL("http://127.0.0.1:4723/wd/hub"),capabilities);

}

I couldn't able to start the Emulator through the code.

Suggestions please.

网友答案:

I used the below command line arguments to start the genymotion emulator

 CommandLine launchEmul = new CommandLine("Genymotion player path");
 launchEmul.addArgument("--vm-name");
 launchEmul.addArgument("\""+deviceName+"\"");
 executor.setExitValue(1);
 executor.execute(launchEmul, resultHandler);
相关阅读:
Top