How to set ANDROID_HOME in MacOS

Views: 1409 Ask New Question

When i try to run my Appium script, i am getting following error.

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

Following is the full stacktrace

Exception in thread "main" org.openqa.selenium.WebDriverException: 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. (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 689 milliseconds
Build info: version: '2.47.1', revision: 'unknown', time: '2015-07-30 11:02:44'
System info: host: 'MacBook-Pro.local', ip: '', 'Mac OS X', os.arch: 'x86_64', os.version: '10.13.2', java.version: '1.8.0_71'
Driver info:
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
    at java.lang.reflect.Constructor.newInstance(
    at org.openqa.selenium.remote.ErrorHandler.createThrowable(
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(
    at org.openqa.selenium.remote.RemoteWebDriver.execute(
    at io.appium.java_client.DefaultGenericMobileDriver.execute(
    at io.appium.java_client.AppiumDriver.execute(
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(
    at io.appium.java_client.DefaultGenericMobileDriver.<init>(
    at io.appium.java_client.AppiumDriver.<init>(
    at io.appium.java_client.AppiumDriver.<init>(
    at com.qentelli.mobe.AndroidInspector.main(

How to set ANDROID_HOME in MacOS?

On By

1 Answer

Run the following command to set ANDROID_HOME in MacOS

echo export "ANDROID_HOME=/Users/<User Name>/Library/Android/sdk" >> ~/.bash_profile

Note: Replace <User Name> with the user name.

Once done, restart the terminal, if you now run the following command you should see the value for ANDROID_HOME


Output: /Users/<User Name>/Library/Android/sdk

On By

Answer This Question