Error: ANDROID_HOME is not set and "android" command not in your PATH on OS X
Option 1
for windows
Right click on My computer -> properties -> Advanced system setting -> Environment Variables
Now Edit Path on system variables to
;/yourSdkHome/tools;/youSdkHome/platform-tools
Option 2
In Windows machine, Open Command prompt and enter each of this commands one by one
set ANDROID_HOME=**C:\\android-sdk-windows**
set PATH=%PATH%;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools
In MAC Machine, open Terminal and enter these one by one
export ANDROID_HOME=/<installation location>/android-sdk-macosx
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
Note - C:\\android-sdk-windows
should be replaced by the path of Android SDK in your machine.
<installation location>
should be replaced by the path of Android SDK in your machine.
Example
in MAC machine, if install location is ~/adt-bundle-mac-x86_64/sdk
first line should be
export ANDROID_HOME=~/adt-bundle-mac-x86_64/sdk
Peter Stuart
My name is Peter. I am a web developer always seeking to learn and grow in my graft. I'm usually asking more than answering on here, but will help where and when I can
Updated on March 27, 2020Comments
-
Peter Stuart about 4 years
I am getting this error in terminal when attempting to execute this command:
$ cordova platform add android
I read these answers here:
ANDROID_HOME is not set and "android" command not in your PATH Phonegap
however I don't know where to place the code they provide.
I am running OS X.
-
Peter Stuart over 9 yearsSorry, I should have specified, I am running on OSX :)
-
Peter Stuart over 9 yearsI know get this Error: ANDROID_HOME is set to a non-existant path: //android-sdk-macosx at /Users/xxxx/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/lib/check_reqs.js:162:19
-
Prem over 9 years@PeterStuart, Find the path of Android SDK by using the search in MAC machine and set that path
-
Peter Stuart over 9 yearsI cant find it in the search, am I missing something daft?