Gitanjali
Gitanjali

Reputation: 13

ANDROID_HOME environment variable not set error

org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Could not find adb. Please set the ANDROID_HOME environment variable with the Android SDK root directory path.) (WARNING: The server did not provide any stacktrace information)

I have already set my ANDROID_HOME directory to sdk path . echo $ANDROID_HOME=/Users/xyz/Library/Android/sdk

i still get this error by appium server.Using testNG framework..Running my first app

Upvotes: 0

Views: 6490

Answers (2)

Farid Haq
Farid Haq

Reputation: 4199

You need to export tools and platform-tools to access adb command. If you using mac open then terminal and If you are in windows open .bash_profile and execute as follows

export ANDROID_HOME=/Users/$(whoami)/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_HOME/tools

Upvotes: 1

davecroman
davecroman

Reputation: 436

It looks like it can't find adb from your defined paths. Check if you've added the android platform-tools folder to the $PATH variable. It's the one that contains adb

In your .bash_profile, try adding this line:

export PATH="$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools"

In the above line, I added both the tools and platform-tools folder in the PATH variable.

Upvotes: 0

Related Questions