Reputation: 179
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?
Upvotes: 6
Views: 27053
Reputation: 524
Sometimes this error occurs due to changing in shell for terminal.
If you previously working with .bash profile and sudden if terminal updated to zsh then your .bash profile will not work for setting ANDROID_HOME and other paths.
So you need to change by default again to bash profile as below.
ZSH to BASh shell
With macOS Catalina, Apple is now using Zsh as the default shell. We love Zsh, but the trusty old Bash shell is still included with macOS, and you can quickly switch back to Bash if you prefer. Zsh is only the default shell on newly created user accounts, so any existing accounts you have on an upgraded Mac will still use Bash by default unless you change it. Each user account has its own default shell preference.
From the Terminal To change a user account’s default shell on macOS, simply run the chsh -s (change shell) command in a Terminal window.
Change the default shell to Bash by running the following command:
chsh -s /bin/bash
You’ll have to enter your user account’s password. Finally, close the Terminal window and reopen it. You’ll be using Bash instead of Zsh.
Change the default shell back to Zsh by running this command:
chsh -s /bin/zsh
Enter your password when prompted. After you close the terminal window and reopen it, you’ll be using Zsh.
You can see a list of included shells you can select by running the following command:
cat /etc/shells
Upvotes: 0
Reputation: 18
After troubleshooting the same issue for a few hours here is what worked for me and should work for you too:
I hope it works for you as well. Have fun
Upvotes: 0
Reputation: 5203
For Windows 10:
Right-click on 'My Computer' and select 'Properties'. Then select 'Advance System Settings' from Left Panel. Select 'Environment Variables' from new pop-up window.
Add variable 'ANDROID_HOME' with value of 'C:\Program Files (x86)\Android\android-sdk'.
Close all the windows and restart the Appium. (Important)
It works for me.
Upvotes: 2
Reputation: 111
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:
In Linux:
/etc/environment
file.export ANDROID_HOME="/opt/intallation-location/android-sdk"
Upvotes: 2