Couldn't find adb in PATH

Appium version 1.13.0 prints bellow lines and adb can’t find devices.

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. 16:04:57 16:04:57 Completed executing following method : AbstractTestNGCucumberTests.setUpClass 16:04:57 AbstractTestNGCucumberTests.runScenario(cucumber.api.testng.PickleEventWrapper, cucumber.api.testng.CucumberFeatureWrapper)[pri:0, instance:automatedCarmelTests.Launchers.app.AppExportPINNeededLauncher@80169cf] 16:04:57 AbstractTestNGCucumberTests.runScenario(cucumber.api.testng.PickleEventWrapper, cucumber.api.testng.CucumberFeatureWrapper)[pri:0, instance:automatedCarmelTests.Launchers.app.AppExportPINNeededLauncher@80169cf] 16:04:57 16:04:57 About to begin executing following method : AbstractTestNGCucumberTests.runScenario 16:04:57 @AppExportPIN 16:04:57 Feature: AppPDF.NeedPin 16:04:57 16:04:57 @AppExportPIN 16:04:57 Scenario: AppPDF.NeedPin e[90m# features/carmel/app/AppExportPINNeeded.feature:4e[0m 16:04:57 [debug] e[35m[AndroidDriver]e[39m Shutting down Android driver 16:04:57 [debug] e[35m[AndroidDriver]e[39m Called deleteSession but bootstrap wasn’t active 16:04:57 [debug] e[35m[BaseDriver]e[39m Event ‘APPIUM URL: http://127.0.0.1:6079/wd/hub 16:04:57 newSessionStarted’ logged at 1563714296868 (16:04:56 GMT+0300 (IDT)) 16:04:57 [debug] e[35m[W3C]e[39m Encountered internal error running command: Error: Could not find ‘adb’ in PATH. Please set the ANDROID_HOME envirCreating Android Driver…! 16:04:57 onment variable with the Android SDK root directory path. 16:04:57 [debug] e[35m[W3C]e[39m at ADB. (/home/automator/.nvm/versions/node/v9.4.0/lib/node_modules/appium/node_moappiumGridRun: true 16:04:57 Call download apk method 16:04:57 dules/appium-adb/lib/tools/system-calls.js:135:11) 16:04:57 [debug] e[35m[W3C]e[39mAPK PATH: /var/lib/jenkins/workspace/Carmel_App/automation/automatedCarmelTests/resources/apps/Colpo-3.17.02-2019_07_08_14.56-regular-staging-debug.apk 16:04:57 at Generator.throw () 16:04:57 [debug] e[35m[W3C]e[39m at asyncGeneratorStep (/home/automator/.nvm/versions/node/v9.4.0/lib/node_modules/appium/node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24) 16:04:57 [debug] e[35m[W3C]e[39m at _throw (/home/automator/.nvm/versions/node/v9.4.0/lib/node_modules/appium/node_modules/@babel/runtime/helpers/asyncToGenerator.js:29:9) 16:04:57 [debug] e[35m[W3C]e[39m at 16:04:57 e[35m[HTTP]e[39m e[37m<-org.openqa.selenium.WebDriverException: It is impossible to create a new session because ‘createSession’ which takes HttpClient, InputStream and long was not found or it is not accessible 16:04:57 Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:17:03’ 16:04:57 System info: host: ‘Automation’, ip: ‘127.0.1.1’, os.name: ‘Linux’, os.arch: ‘amd64’, os.version: ‘4.15.0-54-generic’, java.version: ‘1.8.0_212’ 16:04:57 Driver info: driver.version: Driver 16:04:57 - POST / at io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(AppiumCommandExecutor.java:195) 16:04:57 w at io.appium.java_client.remote.AppiumCommandExecutor.createSession(AppiumCommandExecutor.java:209)d 16:04:57 at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:231) 16:04:57 /h at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552) 16:04:57 u at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)b 16:04:57 at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)/sessi 16:04:57 at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)on e[3 16:04:57 at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:213)9me[31 16:04:57 at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:131)m500e[39m 16:04:57 at io.appium.java_client.DefaultGenericMobileDriver.(DefaultGenericMobileDriver.java:38) e[ 16:04:57 at io.appium.java_client.AppiumDriver.(AppiumDriver.java:84)90m 16:04:57 at io.appium.java_client.AppiumDriver.(AppiumDriver.java:94)154 16:04:57 at io.appium.java_client.android.AndroidDriver.(AndroidDriver.java:93)ms - 16:04:57 at automationInfra.com.driver.BaseAppiumDriver.createAndroidDriver(BaseAppiumDriver.java:120) 819 16:04:57 at automationInfra.com.abstractdriver.Driver.createAndroidDriver(Driver.java:60)e[39 16:04:57 at automatedCarmelTests.definitions.app.AppLoginDefinition.open_app(AppLoginDefinition.java:64)m 16:04:57 e[ 16:04:57 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)35m[HTTP] 16:04:57 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)e[3 16:04:57 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)9m e 16:04:57 at java.lang.reflect.Method.invoke(Method.java:498)[90m 16:04:57 at cucumber.runtime.Utils$1.call(Utils.java:26)e[39m 16:04:57 16:04:57 at cucumber.runtime.Timeout.timeout(Timeout.java:16) 16:04:57 at cucumber.runtime.Utils.invoke(Utils.java:20) 16:04:57 at cucumber.runtime.java.JavaStepDefinition.execute(JavaStepDefinition.java:48) 16:04:57 at cucumber.runtime.PickleStepDefinitionMatch.runStep(PickleStepDefinitionMatch.java:50) 16:04:57 at cucumber.runner.TestStep.executeStep(TestStep.java:55) 16:04:57 at cucumber.runner.TestStep.run(TestStep.java:42) 16:04:57 at cucumber.runner.PickleStepTestStep.run(PickleStepTestStep.java:53) 16:04:57 at cucumber.runner.TestCase.run(TestCase.java:47) 16:04:57 at cucumber.runner.Runner.runPickle(Runner.java:44) 16:04:57 at cucumber.api.testng.TestNGCucumberRunner.runScenario(TestNGCucumberRunner.java:56) 16:04:57 at cucumber.api.testng.AbstractTestNGCucumberTests.runScenario(AbstractTestNGCucumberTests.java:22) 16:04:57 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 16:04:57 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 16:04:57 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 16:04:57 at java.lang.reflect.Method.invoke(Method.java:498) 16:04:57 at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:124) 16:04:57 at org.testng.internal.Invoker.invokeMethod(Invoker.java:583) 16:04:57 at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:719) 16:04:57 at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:989) 16:04:57 at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125) 16:04:57 at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109) 16:04:57 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 16:04:57 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 16:04:57 at java.lang.Thread.run(Thread.java:748) 16:04:57 Caused by: java.lang.reflect.InvocationTargetException 16:04:57 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 16:04:57 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 16:04:57 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 16:04:57 at java.lang.reflect.Method.invoke(Method.java:498) 16:04:57 at io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(AppiumCommandExecutor.java:185) 16:04:57 … 44 more 16:04:57 Caused by: org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Could not find ‘adb’ in PATH. Please set the ANDROID_HOME environment variable with the Android SDK root directory path. 16:04:57 Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:17:03’ 16:04:57 System info: host: ‘Automation’, ip: ‘127.0.1.1’, os.name: ‘Linux’, os.arch: ‘amd64’, os.version: ‘4.15.0-54-generic’, java.version: ‘1.8.0_212’ 16:04:57 Driver info: driver.version: Driver 16:04:57 remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not find ‘adb’ in PATH. Please set the ANDROID_HOME environment variable with the Android SDK root directory path. 16:04:57 at getResponseForW3CError (/home/automator/.nvm/versions/node/v9.4.0/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:826:9) 16:04:57 at asyncHandler (/home/automator/.nvm/versions/node/v9.4.0/lib/node_modules/appium/node_modules/appium-base-driver/lib/protocol/protocol.js:447:37) 16:04:57 at 16:04:57 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 16:04:57 at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) 16:04:57 at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) 16:04:57 at java.lang.reflect.Constructor.newInstance(Constructor.java:423) 16:04:57 at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$errorHandler$0(W3CHandshakeResponse.java:62) 16:04:57 at org.openqa.selenium.remote.HandshakeResponse.lambda$getResponseFunction$0(HandshakeResponse.java:30) 16:04:57 at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:126) 16:04:57 at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) 16:04:57 at java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958) 16:04:57 at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126) 16:04:57 at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:499) 16:04:57 at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:486) 16:04:57 at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) 16:04:57 at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152) 16:04:57 at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) 16:04:57 at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464) 16:04:57 at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:128) 16:04:57 … 49 more 16:04:57 java.lang.Exception: Key: appiumDriver Object: null 16:04:57 at automationInfra.com.abstractdriver.ThreadPool.putAppiumDriver(ThreadPool.java:126) 16:04:57 at automationInfra.com.abstractdriver.Driver.createAndroidDriver(Driver.java:61) 16:04:57 at automatedCarmelTests.definitions.app.AppLoginDefinition.open_app(AppLoginDefinition.java:64) 16:04:57 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 16:04:57 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 16:04:57 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 16:04:57 at java.lang.reflect.Method.invoke(Method.java:498) 16:04:57 at cucumber.runtime.Utils$1.call(Utils.java:26) 16:04:57 at cucumber.runtime.Timeout.timeout(Timeout.java:16) 16:04:57 at cucumber.runtime.Utils.invoke(Utils.java:20) 16:04:57 at cucumber.runtime.java.JavaStepDefinition.execute(JavaStepDefinition.java:48) 16:04:57 at cucumber.runtime.PickleStepDefinitionMatch.runStep(PickleStepDefinitionMatch.java:50) 16:04:57 at cucumber.runner.TestStep.executeStep(TestStep.java:55) 16:04:57 at cucumber.runner.TestStep.run(TestStep.java:42) 16:04:57 at cucumber.runner.PickleStepTestStep.run(PickleStepTestStep.java:53) 16:04:57 at cucumber.runner.TestCase.run(TestCase.java:47) 16:04:57 at cucumber.runner.Runner.runPickle(Runner.java:44) 16:04:57 at cucumber.api.testng.TestNGCucumberRunner.runScenario(TestNGCucumberRunner.java:56) 16:04:57 at cucumber.api.testng.AbstractTestNGCucumberTests.runScenario(AbstractTestNGCucumberTests.java:22) 16:04:57 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 16:04:57 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 16:04:57 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 16:04:57 at java.lang.reflect.Method.invoke(Method.java:498) 16:04:57 at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:124) 16:04:57 at org.testng.internal.Invoker.invokeMethod(Invoker.java:583) 16:04:57 at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:719) 16:04:57 at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:989) 16:04:57 at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125) 16:04:57 at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109) 16:04:57 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 16:04:57 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 16:04:57 at java.lang.Thread.run(Thread.java:748) 16:04:57 e[31mGiven e[0me[31mopen appe[0m e[90m# AppLoginDefinition.open_app()e[0m 16:04:57 e[31mjava.lang.NullPointerException 16:04:57 at automationInfra.com.abstractdriver.Driver.createAndroidDriver(Driver.java:62) 16:04:57 at automatedCarmelTests.definitions.app.AppLoginDefinition.open_app(AppLoginDefinition.java:64) 16:04:57 at ✽.open app(features/carmel/app/AppLoginFailureTest.feature:6)

Android Home is correct.
The problem that I always need to kill/start server before running the tests.

mentioned this, may be you should check your iOS sdk platforms folder, make sure there are include version that your testing mobile device is


if not, download.

I’am also encountering this and work well after do I mentioned.