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:$ANDROID_HOME/tools
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

I am a greenhorn Data Science student with interest in finding patterns in data. My language of choice is Python and I am starting to get my hands dirty with R.

Checkout my portfolio here: https://confusedcoders.com/nikita-sharma-greenhorn-data-science-student

I blog on Medium.com [1] and ConfusedCoders.com [2]. I share my code on Github.com [3].

  1.  https://medium.com/@nikkisharma536
  2. https://confusedcoders.com/author/nikita
  3. https://github.com/nikkisharma536

Leave a Reply

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