错误:Logcat捕获失败:生成ENOENT

时间:2014-09-23 12:52:45

标签: java android node.js appium

Starting Node Server 
info: Welcome to Appium v1.2.0 (REV e53f49c706a25242e66d36685c268b599cc18da5)
debug: Non-default server args: {"address":"127.0.0.1","logNoColors":true,"platformName":"Android","platformVersion":"19","automationName":"Appium"}
info: Appium REST http interface listener started on 127.0.0.1:4723
info: LogLevel: debug
info: --> POST /wd/hub/session {"desiredCapabilities":{"automationName":"Appium","platform":"Android","platformVersion":"19","app":"C:\\Users\\qadeer\\Documents\\NetBeansProjects\\convoTest\\app\\Convo.apk","platformName":"Android","deviceName":"01899dd5c94c237a","browserName":"","app-package":"com.convo.android","app-activity":".ConvoMain","version":"4.4.2"}}
debug: Appium request initiated at /wd/hub/session
debug: Request received with params: {"desiredCapabilities":{"automationName":"Appium","platform":"Android","platformVersion":"19","app":"C:\\Users\\qadeer\\Documents\\NetBeansProjects\\convoTest\\app\\Convo.apk","platformName":"Android","deviceName":"01899dd5c94c237a","browserName":"","app-package":"com.convo.android","app-activity":".ConvoMain","version":"4.4.2"}}
info: Starting android appium
debug: The following desired capabilities were provided, but not recognized by appium. They will be passed on to any other services running on this server. : platform, app-package, app-activity, version
debug: No appActivity desired capability or server param. Parsing from apk.
debug: No appPackage desired capability or server param. Parsing from apk.
debug: Using local app from desired caps: C:\Users\qadeer\Documents\NetBeansProjects\convoTest\app\Convo.apk
debug: Creating new appium session baf82af5-dfab-4837-8fa0-a56da25fa1ec
debug: Using fast reset? true
debug: Preparing device for session
debug: Checking whether app is actually present
debug: Checking whether adb is present
debug: Using adb from D:\Soft backup\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb.exe

info: Retrieving device
debug: Trying to find a connected android device
debug: Getting connected devices...
debug: executing: "D:\Soft backup\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb.exe" devices
debug: 1 device(s) connected
info: Found device 01899dd5c94c237a
debug: Setting device id to 01899dd5c94c237a
debug: Waiting for device to be ready and to respond to shell commands (timeout = 5)
debug: executing: "D:\Soft backup\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb.exe" -s 01899dd5c94c237a wait-for-device
debug: executing: "D:\Soft backup\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb.exe" -s 01899dd5c94c237a shell "echo 'ready'"
debug: Starting logcat capture
error: Logcat capture failed: spawn ENOENT
debug: Stopping logcat capture

这是appium应用程序服务器日志我收到此错误

error: Logcat capture failed: spawn ENOENT
debug

:停止logcat捕获

我的申请被绞死了 这是我的能力

    File app = new File( "app/Sat.apk");

            if(app.exists())
                System.out.println("exsist");

            DesiredCapabilities capabilities = new DesiredCapabilities();
            capabilities.setCapability(CapabilityType.BROWSER_NAME, "");
            capabilities.setCapability(CapabilityType.PLATFORM, "Android");
            capabilities.setCapability(CapabilityType.VERSION, "4.4.2");
            capabilities.setCapability("automationName","Appium");
            capabilities.setCapability("platformName","Android");
            capabilities.setCapability("platformVersion", "19");
            //capabilities.setCapability("deviceName", "emulator-5554");
            capabilities.setCapability("deviceName", "01899dd5c94c237a");
            //capabilities.setCapability("device-orientation", "portrait"); 
            capabilities.setCapability("app", app.getAbsolutePath());
            capabilities.setCapability("app-package", "com.sat.android");
            capabilities.setCapability("app-activity", ".SatMain");


      try {
        driver = new RemoteWebDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
    } catch (MalformedURLException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
      driver.manage().timeouts().implicitlyWait(80, TimeUnit.SECONDS);  
              driver.quit();

直到现在我无法理解为什么logcat没有显示响应的问题

请帮助它将不胜感谢:)

4 个答案:

答案 0 :(得分:3)

我有类似的问题,我通过删除sdk文件夹路径中的空格来解决它。 在您的情况下,请尝试将路径重命名为

" d:\ Softbackup \ ADT-束 - 窗口x86_64-20131030 \ SDK \"而不是

" D:\ Soft backup \ adt-bundle-windows-x86_64-20131030 \ sdk \"

答案 1 :(得分:3)

在Mac中,当更新到与IntelliJ Android Studio捆绑的新Android SDK时,sdk路径更改为类似/Applications/Android Studio.app/sdk的内容。空白正在使我的appium会话失败。令人惊讶的是appium-doctor检查没有给出任何建议。

我解决了这个问题

ln -s /Applications/Android\ Studio.app/sdk /Users/sergio/Software/android_sdk
export ANDROID_HOME=/Users/sergio/Software/android_sdk

答案 2 :(得分:0)

您将API级别置于platformVersion功能中,而Appium不知道version功能(您设置为4.4.2)是什么,因此忽略它。

debug: The following desired capabilities were provided, but not recognized by appium. They will be passed on to any other services running on this server. : platform, app-package, app-activity, version

您应该删除CapabilityType.VERSION, "4.4.2"并改为使用platformVersion

<强>尝试:

 DesiredCapabilities capabilities = new DesiredCapabilities();
 capabilities.setCapability(CapabilityType.PLATFORM, "Android");
 capabilities.setCapability("automationName","Appium");
 capabilities.setCapability("platformName","Android");
 capabilities.setCapability("platformVersion", "4.4.2");
 //capabilities.setCapability("deviceName", "emulator-5554");
 capabilities.setCapability("deviceName", "01899dd5c94c237a");
 //capabilities.setCapability("device-orientation", "portrait"); 
 capabilities.setCapability("app", app.getAbsolutePath());

答案 3 :(得分:0)

您的功能问题是在DeviceName中您必须提及&#34; Android&#34;

您必须使用以下功能:

       capabilities.SetCapability("appium-version", "1.2.0");
        capabilities.SetCapability("platformName", "Android");
        capabilities.SetCapability("platformVersion", "4.3");
        capabilities.SetCapability("deviceName", "Android");
        capabilities.SetCapability("app","--" );
        capabilities.SetCapability("app-package","--" );

        capabilities.SetCapability("app-activity", "--");