Appium Error : WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Could not find adb Please set the ANDROID_HOME environment variable with the Android SDK root directory path

This Appium error is sometimes misleading. Here is how I fixed this error.

Check if Path variables are present

Check if the $ANDROID_HOME and$ JAVA_HOME path variables are set. Also check if the path variables are added to the $PATH. You can add these variables by adding these lines to your ~/.bashrc file:

export ANDROID_HOME=~/Android/Sdk
export PATH=$PATH:$JAVA_HOME/bin

source ~/.bashrc

Install Appium doctor

Sometimes we miss other things in our setup. The best way forward is to start appium doctor. You can install appium doctor by:

npm install appium-doctor -g
$ appium-doctor

Thats how the appium doctor check should look like:

Screenshot from 2018-04-19 23:01:12

Restart Appium in a new terminal

Yes this is required if you have made PATH changes. Appium should be restarted in a new terminal to get the path changes.

Alternatively, closing Appium, running source on ~/.bashrc and restarting Appium also works. But restarting Appium in a new terminal is always a safer option.

That’s all for this post. Hope it helps.

If you have still not solved the issue please run appium in debug mode and post the error logs here in comments:

$ appium --debug

Leave a Reply

Your email address will not be published. Required fields are marked *