Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not find adb Please set the ANDROID_HOME environment variable with the Android SDK root directory path

I am getting the below error 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. 
(Selenium::WebDriver::Error::UnknownError)

I have setup all the below:

info AppiumDoctor Appium Doctor v.1.4.2
info AppiumDoctor ### Diagnostic starting ###
info AppiumDoctor  ✔ The Node.js binary was found 
at:/usr/local/bin/node
info AppiumDoctor  ✔ Node version is 7.10.0
info AppiumDoctor  ✔ ANDROID_HOME is set to: 
/Users/shafiq.malik/Library/Android/sdk
info AppiumDoctor  ✔ JAVA_HOME is set to: /Library/Java/Home
info AppiumDoctor  ✔ adb exists at: 
/Users/shafiq.malik/Library/Android/sdk/platform-tools/adb
info AppiumDoctor  ✔ android exists at: 
/Users/shafiq.malik/Library/Android/sdk/tools/android
info AppiumDoctor  ✔ emulator exists at: 
/Users/shafiq.malik/Library/Android/sdk/tools/emulator
info AppiumDoctor  ✔ Bin directory of $JAVA_HOME is set
info AppiumDoctor ### Diagnostic completed, no fix needed. ###
info AppiumDoctor
info AppiumDoctor Everything looks good, bye!
info AppiumDoctor

I am not sure what I am missing. Can somebody please advise?

like image 348
Shafiq Ahmed Khan Avatar asked May 25 '17 15:05

Shafiq Ahmed Khan


2 Answers

You need to add the path to the android-sdk to ANDROID_HOME environment variable. e.g. C:\installation-location\android-sdk or /opt/intallation-location/android-sdk

In Windows 8 & 10:

  1. In Search, search for and then select: System (Control Panel)
  2. Click the Advanced system settings link.
  3. Click Environment Variables. If the ANDROID_HOME environment variable does not exist, click New.
  4. In the Edit System Variable (or New System Variable) window, specify the value of the ANDROID_HOME environment variable. Click OK. Close all remaining windows by clicking OK.

In Linux:

  1. Edit /etc/environment file.
  2. Append the line export ANDROID_HOME="/opt/intallation-location/android-sdk"
  3. Save the file and then log out and log in.
like image 161
Kaustav Das Avatar answered Nov 17 '22 17:11

Kaustav Das


For Windows 10:

  1. Right-click on 'My Computer' and select 'Properties'. Then select 'Advance System Settings' from Left Panel. Select 'Environment Variables' from new pop-up window.

  2. Add variable 'ANDROID_HOME' with value of 'C:\Program Files (x86)\Android\android-sdk'.

  3. Close all the windows and restart the Appium. (Important)

It works for me.

like image 2
Hassan Rahman Avatar answered Nov 17 '22 15:11

Hassan Rahman