尝试通过Appium 1.3.4.1启动第三方模拟器Genymotion。但它失败了。
我做了以下事情。
我从appium禁用Launch AVD并通过代码启动Genymotion AVD。
我在这里粘贴整个代码:
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);
}
我无法通过代码启动模拟器。 建议请。
答案 0 :(得分:0)
我使用下面的命令行参数来启动genymotion模拟器
CommandLine launchEmul = new CommandLine("Genymotion player path");
launchEmul.addArgument("--vm-name");
launchEmul.addArgument("\""+deviceName+"\"");
executor.setExitValue(1);
executor.execute(launchEmul, resultHandler);