ERROR运行Appium命令:ENOENT,没有这样的文件或目录

时间:2014-12-22 07:52:21

标签: java android selenium-webdriver appium

当我尝试连接到appium服务器时,会显示以下错误。

ERROR运行Appium命令:ENOENT,没有这样的文件或目录' D:\ Android \ android-sdk \ platform-tools; \ build-tools'

以下是我的代码:

@BeforeClass
public void setUp() throws MalformedURLException{
    DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setCapability("deviceName", "Android Emulator");
    capabilities.setCapability(CapabilityType.BROWSER_NAME, ""); //Name of mobile web browser to automate. Should be an empty string if automating an app instead.
    capabilities.setCapability("platformVersion", "4.4");
    capabilities.setCapability(CapabilityType.PLATFORM, "Windows");
    capabilities.setCapability("platformName", "Android");
    capabilities.setCapability("app", "C:/Appium/AppiumForWindows-1.2.4.1/WishAndGreet.apk");
    //capabilities.setCapability("app", "C:/Appium/AppiumForWindows-1.2.4.1/TestApp");
    //capabilities.setCapability("app-package", "com.example.testapp"); //Replace with your app's package
    //capabilities.setCapability("app-activity", ".MainActivity"); //Replace with app's Activity
    driver = new RemoteWebDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
}

1 个答案:

答案 0 :(得分:2)

是的,最后我得到了这个问题的解决方案。我犯的错误非常小。 其实我在环境变量中设置了sdk platform tools文件夹的路径,但它必须是sdk根文件夹。

使用 D:\ Android \ android-sdk 代替 D:\ Android \ android-sdk \ platform-tools

希望它会有所帮助。投票如果它会。 :)