Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Appium logcat capture failed: spawn ENOENT (no spaces in path)

Here is my setup: Appium 1.3.7 on Windows, real Android device with 4.1.2, Eclipse, TestNG. Path to SDK without spaces. Sample calculator test

DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("BROWSER_NAME", "Chrome");
capabilities.setCapability("automationName", "Selendroid");
capabilities.setCapability("platformVersion", "4.1.2");
capabilities.setCapability("deviceName","0123456789ABCDEF");
capabilities.setCapability("platformName","Android");
capabilities.setCapability("appPackage", "com.android.calculator2");
capabilities.setCapability("appActivity","com.android.calculator2.Calculator); 

Note:

  1. Removing the capabilities.setCapability("BROWSER_NAME", "Chrome"); line does not change anything
  2. Path to SDK is added into PATH variable, so it works without setting ANDROID_HOME variable

Here is the server output:

> info: Welcome to Appium v1.3.7 (REV 72fbfaa116d3d9f6a862600ee99cf02f6d0e2182)
> info: Appium REST http interface listener started on 127.0.0.1:4723
> info: [debug] Non-default server args: {"address":"127.0.0.1","logNoColors":true,"platformName":"Android","platformVersion":"16","automationName":"Selendroid"}
> info: Console LogLevel: debug
> info: --> POST /wd/hub/session {"desiredCapabilities":{"appPackage":"com.android.calculator2","appActivity":"com.android.calculator2.Calculator","BROWSER_NAME":"Chrome","platformVersion":"4.1.2","automationName":"Selendroid","platformName":"Android","deviceName":"0123456789ABCDEF"}}
> info: Client User-Agent string: Apache-HttpClient/4.3.6 (java 1.5)
> info: [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. : BROWSER_NAME
> info: [debug] Didn't get app but did get Android package, will attempt to launch it on the device
> info: [debug] Creating new appium session 623f7324-87ac-493e-9df3-2ce7f6742ab8
> info: [debug] Starting selendroid server
> info: [debug] Getting Java version
> info: Java version is: 1.8.0_45
> info: [debug] Checking whether adb is present
> warn: The ANDROID_HOME environment variable is not set to the Android SDK root directory path. ANDROID_HOME is required for compatibility with SDK 23+. Checking along PATH for adb.
> info: [debug] executing cmd: where adb
> info: [debug] Using adb from D:\Android\android-sdk\platform-tools\adb.exe
> 
> info: [debug] Checking whether selendroid is built yet
> info: [debug] Selendroid server exists!
> info: [debug] Using fast reset? true
> info: [debug] Preparing device for session
> info: [debug] Not checking whether app is present since we are assuming it's already on the device
> info: Retrieving device
> info: [debug] Trying to find a connected android device
> info: [debug] Getting connected devices...
> info: [debug] executing cmd: "D:\Android\android-sdk\platform-tools\adb.exe" devices
> info: [debug] 1 device(s) connected
> info: Found device 0123456789ABCDEF
> info: [debug] Setting device id to 0123456789ABCDEF
> info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
> info: [debug] executing cmd: "D:\Android\android-sdk\platform-tools\adb.exe" -s 0123456789ABCDEF wait-for-device
> info: [debug] executing cmd: "D:\Android\android-sdk\platform-tools\adb.exe" -s 0123456789ABCDEF shell "echo 'ready'"
> info: [debug] Starting logcat capture
> error: Logcat capture failed: spawn ENOENT
> info: [debug] Cleaning up appium session
> error: Failed to start an Appium session, err was: Error: spawn ENOENT
> info: [debug] Error: spawn ENOENT
>     at errnoException (child_process.js:988:11)
>     at Process.ChildProcess._handle.onexit (child_process.js:779:34)
> info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: spawn ENOENT)","code":"ENOENT","errno":"ENOENT","syscall":"spawn","origValue":"spawn ENOENT"},"sessionId":null}
> info: <-- POST /wd/hub/session 500 331.069 ms - 197 

Any ideas?

like image 838
Nick Slavsky Avatar asked Sep 29 '22 02:09

Nick Slavsky


1 Answers

I suspect that you put the wrong path inside the PATH or/and ANDROID_HOME. You've received the warning

warn: The ANDROID_HOME environment variable is not set to the Android SDK root directory path. ANDROID_HOME is required for compatibility with SDK 23+. Checking along PATH for adb.

Please ensure that the PATH or/and ANDROID_HOME contains D:\Android\android-sdk but not D:\Android\android-sdk\platform-tools

like image 87
Eugene Avatar answered Oct 20 '22 13:10

Eugene