【问题标题】:UiAutomator quit before it successfully launchedUiAutomator 在成功启动之前退出
【发布时间】:2015-05-23 17:41:13
【问题描述】:

尝试通过 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);

    }

我无法通过代码启动模拟器。 请提出建议。

【问题讨论】:

  • @IdanE 是的,我使用命令行参数来启动模拟器。

标签: android eclipse selenium appium


【解决方案1】:

我使用下面的命令行参数来启动 genymotion 模拟器

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

【讨论】:

    猜你喜欢
    • 2016-05-15
    • 2013-11-25
    • 2019-06-13
    • 1970-01-01
    • 1970-01-01
    • 2015-09-02
    • 2019-12-22
    • 1970-01-01
    • 2020-03-08
    相关资源
    最近更新 更多