Appium error connecting android device

Hi,

I am getting the following error log on Appium server, when running test script on Eclipse…

C:\Appium\node_modules\appium\bin>node appium.js
info: Welcome to Appium v1.2.3 (REV 90d746b373f55e8653a251d2ce8c62df37941919)
info: Appium REST http interface listener started on 0.0.0.0:4723
info: Console LogLevel: debug
info: --> POST /wd/hub/session {“desiredCapabilities”:{“app”:“C:\Users\IN01516
\Downloads\huff.apk”,“APP_ACTIVITY”:“com.huffingtonpost.android.section2.Secti
onActivity”,“platformVersion”:“4.3”,“platformName”:“Android”,“deviceName”:“192.1
68.56.102:5555”,“APP_PACKAGE”:“com.huffingtonpost.android”}}
info: [debug] The following desired capabilities were provided, but not recogniz
ed by appium. They will be passed on to any other services running on this serve
r. : APP_ACTIVITY, APP_PACKAGE
info: [debug] No appActivity desired capability or server param. Parsing from ap
k.
info: [debug] No appPackage desired capability or server param. Parsing from apk
.
info: [debug] Using local app from desired caps: C:\Users\IN01516\Downloads\huff
.apk
info: [debug] Creating new appium session 5ecaa953-308a-4c4c-a84e-fca6ecb8197f
info: Starting android appium
info: [debug] Using fast reset? true
info: [debug] Preparing device for session
info: [debug] Checking whether app is actually present
info: [debug] Checking whether adb is present
info: [debug] Using adb from C:\AndroidSDK\sdk\platform-tools\adb.exe
info: Retrieving device
info: [debug] Trying to find a connected android device
info: [debug] Getting connected devices…
info: [debug] executing: “C:\AndroidSDK\sdk\platform-tools\adb.exe” devices
info: [debug] Could not find devices, restarting adb server…
info: [debug] executing: “C:\AndroidSDK\sdk\platform-tools\adb.exe” kill-server
error: Error killing ADB server, going to see if it’s online anyway
info: [debug] Getting connected devices…
info: [debug] executing: “C:\AndroidSDK\sdk\platform-tools\adb.exe” devices
info: [debug] Could not find devices, restarting adb server…
info: [debug] executing: “C:\AndroidSDK\sdk\platform-tools\adb.exe” kill-server
error: Error killing ADB server, going to see if it’s online anyway
info: [debug] Getting connected devices…
info: [debug] executing: “C:\AndroidSDK\sdk\platform-tools\adb.exe” devices
info: [debug] Could not find devices, restarting adb server…
info: [debug] executing: “C:\AndroidSDK\sdk\platform-tools\adb.exe” kill-server
error: Error killing ADB server, going to see if it’s online anyway
info: [debug] Getting connected devices…
info: [debug] executing: “C:\AndroidSDK\sdk\platform-tools\adb.exe” devices
info: [debug] Could not find devices, restarting adb server…
info: [debug] executing: “C:\AndroidSDK\sdk\platform-tools\adb.exe” kill-server
error: Error killing ADB server, going to see if it’s online anyway
info: [debug] Getting connected devices…
info: [debug] executing: “C:\AndroidSDK\sdk\platform-tools\adb.exe” devices
info: [debug] Could not find devices, restarting adb server…
info: [debug] executing: “C:\AndroidSDK\sdk\platform-tools\adb.exe” kill-server
error: Error killing ADB server, going to see if it’s online anyway
info: [debug] Getting connected devices…
info: [debug] executing: “C:\AndroidSDK\sdk\platform-tools\adb.exe” devices
info: [debug] Could not find devices, restarting adb server…
info: [debug] executing: “C:\AndroidSDK\sdk\platform-tools\adb.exe” kill-server
error: Error killing ADB server, going to see if it’s online anyway
info: [debug] Getting connected devices…
info: [debug] executing: “C:\AndroidSDK\sdk\platform-tools\adb.exe” devices
info: [debug] Sent shutdown command, waiting for UiAutomator to stop…
warn: UiAutomator did not shut down fast enough, calling it gone
info: [debug] Cleaning up android objects
info: [debug] Cleaning up appium session
error: Failed to start an Appium session, err was: Error: Could not find a conne
cted Android device.
info: [debug] Error: Could not find a connected Android device.
at ADB.getDevicesWithRetry (C:\Appium\node_modules\appium\node_modules\appiu
m-adb\lib\adb.js:612:15)
at androidCommon.prepareActiveDevice (C:\Appium\node_modules\appium\lib\devi
ces\android\android-common.js:387:12)
at null. (C:\Appium\node_modules\appium\lib\devices\android\andro
id-common.js:325:26)
at C:\Appium\node_modules\appium\node_modules\async\lib\async.js:610:21
at C:\Appium\node_modules\appium\node_modules\async\lib\async.js:249:17
at iterate (C:\Appium\node_modules\appium\node_modules\async\lib\async.js:14
9:13)
at C:\Appium\node_modules\appium\node_modules\async\lib\async.js:160:25
at C:\Appium\node_modules\appium\node_modules\async\lib\async.js:251:21
at C:\Appium\node_modules\appium\node_modules\async\lib\async.js:615:34
at androidCommon.prepareEmulator (C:\Appium\node_modules\appium\lib\devices
android\android-common.js:377:5)
info: [debug] Responding to client with error: {“status”:33,“value”:{“message”:"
A new session could not be created. (Original error: Could not find a connected
Android device.)",“origValue”:“Could not find a connected Android device.”},“ses
sionId”:null}
info: <-- POST /wd/hub/session 500 28753.453 ms - 20

Can anyone please find me a solution for this…Also, When I run “adb devices” on command prompt, its showing that the device is connected…please find it here…

C:\Appium\node_modules\appium\bin>adb devices
List of devices attached
192.168.56.102:5555 device

I am using the following configuration…

Appium 1.2.3
Java 1.8
Android 4.4 device

Please find me a solution for this issue…

2 Likes

You can just try to start appium without passing the device, but that sounds like a bug, appium should detect remote devices by name.
cc @jlipps

Hi sebv,

Thanks for reply. The same error persists after running appium server without passing device.
I could not find solution for this.

I have changed Android sdk too. The error exists as same.

1 Like

Looking at your capabilities it seems that you have passed device name as “192.1
68.56.102:5555” which is incorrect.You have to pass the device name which is given by adb (passing command “adb devices”) or without setting device name in desired capabilities.

1 Like

Hi Mitesh,

I have given the device as passed by adb command only…here is that…

C:\Appium\node_modules\appium\bin>adb devices
List of devices attached
192.168.56.102:5555 device

Ok got it,my bad you have to pass the “deviceName” as “Android” and “192.168.56.102:5555” in “udid”.

@Satish_babu_D
Debug steps

  1. Do adb disconnect : It will disconnect all the attached devices
  2. Connect your devices using usb cable (Kindly don’t connect using wifi)
  3. check adb deviecs : it will list devices (it will give 16 digit alphanumeric number )
  4. Now run the script and check if you are still facing issue. Please let us know what code you are using

Hi,

I followed your steps. But still error persists…please find the error log on Appium server

Starting Node Server
info: Welcome to Appium v1.2.3 (REV 90d746b373f55e8653a251d2ce8c62df37941919)
info: Appium REST http interface listener started on 127.0.0.1:4723
info: [debug] Non-default server args: {“app”:“C:\Users\IN01516\Downloads\huff.apk”,“address”:“127.0.0.1”,“logNoColors”:true,“platformName”:“Android”,“platformVersion”:“17”,“automationName”:“Appium”}
info: Console LogLevel: debug
info: e[37m–>e[39m e[37mPOSTe[39m e[37m/wd/hub/sessione[39m e[90m{“desiredCapabilities”:{“app”:“C:\Users\IN01516\Downloads\huff.apk”,“appPackage”:“com.huffingtonpost.android”,“appActivity”:“com.huffingtonpost.android.section2.SectionActivity”,“platformVersion”:“4.2.2”,“platformName”:“Android”,“deviceName”:“ZH8000PAS2”}}e[39m
info: [debug] Using local app from desired caps: C:\Users\IN01516\Downloads\huff.apk
info: [debug] Creating new appium session d58fdea7-38c1-45bb-a08f-83473e6105c2
info: Starting android appium
info: [debug] Using fast reset? true
info: [debug] Preparing device for session
info: [debug] Checking whether app is actually present
info: [debug] Checking whether adb is present
info: [debug] Using adb from C:\AndroidSDK\sdk\platform-tools\adb.exe
info: Retrieving device
info: [debug] Trying to find a connected android device
info: [debug] Getting connected devices…
info: [debug] executing: “C:\AndroidSDK\sdk\platform-tools\adb.exe” devices
info: [debug] Could not find devices, restarting adb server…
info: [debug] executing: “C:\AndroidSDK\sdk\platform-tools\adb.exe” kill-server
info: [debug] Getting connected devices…
error: Error killing ADB server, going to see if it’s online anyway
info: [debug] executing: “C:\AndroidSDK\sdk\platform-tools\adb.exe” devices
info: [debug] Could not find devices, restarting adb server…
info: [debug] executing: “C:\AndroidSDK\sdk\platform-tools\adb.exe” kill-server
error: Error killing ADB server, going to see if it’s online anyway
info: [debug] Getting connected devices…
info: [debug] executing: “C:\AndroidSDK\sdk\platform-tools\adb.exe” devices
info: [debug] Could not find devices, restarting adb server…
info: [debug] executing: “C:\AndroidSDK\sdk\platform-tools\adb.exe” kill-server
error: Error killing ADB server, going to see if it’s online anyway
info: [debug] Getting connected devices…
info: [debug] executing: “C:\AndroidSDK\sdk\platform-tools\adb.exe” devices
info: [debug] Could not find devices, restarting adb server…
info: [debug] executing: “C:\AndroidSDK\sdk\platform-tools\adb.exe” kill-server
error: Error killing ADB server, going to see if it’s online anyway
info: [debug] Getting connected devices…
info: [debug] executing: “C:\AndroidSDK\sdk\platform-tools\adb.exe” devices
info: [debug] Sent shutdown command, waiting for UiAutomator to stop…
warn: UiAutomator did not shut down fast enough, calling it gone
error: Failed to start an Appium session, err was: Error: Could not find a connected Android device.
info: [debug] Cleaning up android objects
info: [debug] Cleaning up appium session
info: [debug] Error: Could not find a connected Android device.
at ADB.getDevicesWithRetry (C:\Appium\node_modules\appium\node_modules\appium-adb\lib\adb.js:612:15)
at androidCommon.prepareActiveDevice (C:\Appium\node_modules\appium\lib\devices\android\android-common.js:387:12)
at null. (C:\Appium\node_modules\appium\lib\devices\android\android-common.js:325:26)
at C:\Appium\node_modules\appium\node_modules\async\lib\async.js:610:21
at C:\Appium\node_modules\appium\node_modules\async\lib\async.js:249:17
at iterate (C:\Appium\node_modules\appium\node_modules\async\lib\async.js:149:13)
at C:\Appium\node_modules\appium\node_modules\async\lib\async.js:160:25
at C:\Appium\node_modules\appium\node_modules\async\lib\async.js:251:21
at C:\Appium\node_modules\appium\node_modules\async\lib\async.js:615:34
at androidCommon.prepareEmulator (C:\Appium\node_modules\appium\lib\devices\android\android-common.js:377:5)
info: [debug] Responding to client with error: {“status”:33,“value”:{“message”:“A new session could not be created. (Original error: Could not find a connected Android device.)”,“origValue”:“Could not find a connected Android device.”},“sessionId”:null}
info: e[37m<-- POST /wd/hub/session e[39me[31m500e[39me[90m 27812.634 ms - 206e[39m e[90me[39m

Also Please find the error log on eclipse console…

[TestNG] Running:
C:\Users\IN01516\AppData\Local\Temp\testng-eclipse-681270580\testng-customsuite.xml

FAILED CONFIGURATION: @BeforeTest beforeTest
org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Could not find a connected Android device.) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 28.08 seconds
Build info: version: ‘2.44.0’, revision: ‘76d78cf’, time: ‘2014-10-23 20:02:37’
System info: host: ‘HW0776’, ip: ‘172.16.28.221’, os.name: ‘Windows 7’, os.arch: ‘amd64’, os.version: ‘6.1’, java.version: ‘1.8.0_45’
Driver info: io.appium.java_client.android.AndroidDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:204)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:156)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:599)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:176)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:240)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:126)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:153)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:107)
at io.appium.java_client.android.AndroidDriver.(AndroidDriver.java:40)
at com.huffingtonpost.HomePage.beforeTest(HomePage.java:38)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:564)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:213)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138)
at org.testng.TestRunner.beforeRun(TestRunner.java:641)
at org.testng.TestRunner.run(TestRunner.java:609)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
at org.testng.SuiteRunner.run(SuiteRunner.java:240)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
at org.testng.TestNG.run(TestNG.java:1057)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)

SKIPPED CONFIGURATION: @AfterTest afterTest
SKIPPED: f

===============================================
Default test
Tests run: 1, Failures: 0, Skips: 1
Configuration Failures: 1, Skips: 1

Please find the code as well…

package com.huffingtonpost;

import io.appium.java_client.AppiumDriver;

import io.appium.java_client.android.AndroidDriver;

import java.io.File;
import java.net.URL;

import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;

public class HomePage {

public AppiumDriver driver;
  @Test
  public void f() {
      
      
  }
  @BeforeTest
  public void beforeTest() throws Exception {
      
  File appDir = new File("C:\\Users\\IN01516\\Downloads");   // App file path which you are going to Install in  your device
  File app = new File(appDir, "huff.apk");      
      
      DesiredCapabilities capabilities = new DesiredCapabilities();
      
      capabilities.setCapability("deviceName","ZH8000PAS2");
      capabilities.setCapability("platformVersion", "4.2.2");
      capabilities.setCapability("platformName","Android");
      capabilities.setCapability("app", app.getAbsolutePath());
      capabilities.setCapability("appPackage", "com.huffingtonpost.android");
      capabilities.setCapability("appActivity", "com.huffingtonpost.android.section2.SectionActivity");
      
      driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
      
      
  }

  @AfterTest
  public void afterTest() {
  }

}

@Satish_babu_D: Please download latest version of appium and try.
You are using very old version [Welcome to Appium v1.2.3]

@Satish_babu_D did you try to add this line? capabilities.setCapability(“udid”,“192.1
68.56.102:5555”);

@sam_viz I tried it…it didn’t work

@Appium_Master When I try to run latest version of Appium, different error log i encountered. Please find the log…

FAILED CONFIGURATION: @BeforeTest beforeTest
org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: ‘java -version’ failed. Error: Command failed: C:\Windows\system32\cmd.exe /s /c “java -version”
The system cannot find the path specified.
java version “1.8.0_45”
Java™ SE Runtime Environment (build 1.8.0_45-b15)
Java HotSpot™ 64-Bit Server VM (build 25.45-b02, mixed mode)
) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 239 milliseconds
Build info: version: ‘2.44.0’, revision: ‘76d78cf’, time: ‘2014-10-23 20:02:37’
System info: host: ‘HW0776’, ip: ‘172.16.28.221’, os.name: ‘Windows 7’, os.arch: ‘amd64’, os.version: ‘6.1’, java.version: ‘1.8.0_45’
Driver info: io.appium.java_client.android.AndroidDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:204)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:156)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:599)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:176)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:240)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:126)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:153)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:107)
at io.appium.java_client.android.AndroidDriver.(AndroidDriver.java:40)
at com.huffingtonpost.HomePage.beforeTest(HomePage.java:39)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:564)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:213)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138)
at org.testng.TestRunner.beforeRun(TestRunner.java:641)
at org.testng.TestRunner.run(TestRunner.java:609)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
at org.testng.SuiteRunner.run(SuiteRunner.java:240)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
at org.testng.TestNG.run(TestNG.java:1057)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)

SKIPPED CONFIGURATION: @AfterTest afterTest
SKIPPED: f

Restart the appium server and define capabilities as below:

DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(“platformName”, “Android”);
capabilities.setCapability(“browserName”, “Windows”);
capabilities.setCapability(“deviceName”, “Android”);
capabilities.setCapability(“udid”, “ZH8000PAS2”);
capabilities.setCapability(“appPackage”, “com.huffingtonpost.android”);
capabilities.setCapability(“appActivity”,“com.huffingtonpost.android.section2.SectionActivity”);
driver = new AndroidDriver(new URL(“http://127.0.0.1:4723/wd/hub”), capabilities);

@Mitesh_Agrawal
I tried ur code…but the same error exist. I think I tried every possibility…but I need a solution greatly…

Have you set “JAVA_HOME” to your JDK folder in environment variables?

@Satish_babu_D:
Java is not set. Please fix that first

Hi,
Use below caps for android phone.
‘app’: ‘’
‘deviceType’: ‘phone’
‘platformName’: ‘Android’
‘platformVersion’: ‘5.0.1’
‘deviceName’: ‘android_5.0_nexus5_phone’
‘fullReset’: ‘True’

Could anyone helpme out how to execute on windows using real devices

A new session could not be created. (Original error: Could not find a connected Android device.) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 20.75 seconds

info: [debug] executing cmd: C:\Users\SYS\AppData\Local\Android\sdk\platform-tools\adb.exe devices
info: [debug] Cleaning up appium session
info: [debug] Error: Could not find a connected Android device.
at [object Object].ADB.getDevicesWithRetry (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\lib\adb.js:606:15)
at [object Object].androidCommon.prepareActiveDevice (C:\Program Files (x86)\Appium\node_modules\appium\lib\devices\android\android-common.js:400:12)
at [object Object]. (C:\Program Files (x86)\Appium\node_modules\appium\lib\devices\android\android-common.js:326:26)
at C:\Program Files (x86)\Appium\node_modules\appium\node_modules\async\lib\async.js:610:21
at C:\Program Files (x86)\Appium\node_modules\appium\node_modules\async\lib\async.js:249:17
at iterate (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\async\lib\async.js:149:13)
at C:\Program Files (x86)\Appium\node_modules\appium\node_modules\async\lib\async.js:160:25
at C:\Program Files (x86)\Appium\node_modules\appium\node_modules\async\lib\async.js:251:21
at C:\Program Files (x86)\Appium\node_modules\appium\node_modules\async\lib\async.js:615:34
at [object Object].androidCommon.ensureDeviceLocale (C:\Program Files (x86)\Appium\node_modules\appium\lib\devices\android\android-common.js:371:45)
at [object Object].androidCommon.prepareEmulator (C:\Program Files (x86)\Appium\node_modules\appium\lib\devices\android\android-common.js:364:10)
at [object Object]. (C:\Program Files (x86)\Appium\node_modules\appium\lib\devices\android\android-common.js:325:26)
at C:\Program Files (x86)\Appium\node_modules\appium\node_modules\async\lib\async.js:610:21
at C:\Program Files (x86)\Appium\node_modules\appium\node_modules\async\lib\async.js:249:17
at iterate (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\async\lib\async.js:149:13)
at C:\Program Files (x86)\Appium\node_modules\appium\node_modules\async\lib\async.js:160:25
at C:\Program Files (x86)\Appium\node_modules\appium\node_modules\async\lib\async.js:251:21
at C:\Program Files (x86)\Appium\node_modules\appium\node_modules\async\lib\async.js:615:34
at [object Object].androidCommon.checkAppPresent (C:\Program Files (x86)\Appium\node_modules\appium\lib\devices\android\android-common.js:336:5)
at [object Object]. (C:\Program Files (x86)\Appium\node_modules\appium\lib\devices\android\android-common.js:324:26)
at C:\Program Files (x86)\Appium\node_modules\appium\node_modules\async\lib\async.js:610:21
at C:\Program Files (x86)\Appium\node_modules\appium\node_modules\async\lib\async.js:249:17
info: [debug] Responding to client with error: {“status”:33,“value”:{“message”:“A new session could not be created. (Original error: Could not find a connected Android device.)”,“origValue”:“Could not find a connected Android device.”},“sessionId”:null}
info: ← POST /wd/hub/session 500 20300.868 ms - 206

@BeforeClass
public void setUp() throws Exception
{
DesiredCapabilities caps=new DesiredCapabilities();
caps.setCapability(“deviceName”, “41005a7594636000”);
caps.setCapability(“platformName”, “Android”);
caps.setCapability(“platformVersion”, “4.4.2”);

caps.setCapability("browserName", "Chrome");

d = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), caps);
d.manage().timeouts().implicitlyWait(30,TimeUnit.SECONDS);

}

I am unable to execute …Please let me know if anyone came across this error.

Add this along with your path variable.
" C:\Windows\System32"