Error: ANDROID_HOME is not installed, and the "android" command is not in your PATH on OS X

I get this error in the terminal when trying to execute this command:

$ cordova platform add android 

I read these answers here:

Error: ANDROID_HOME is not installed and the "android" command is not in your PATH. You must meet at least one of these conditions.

ANDROID_HOME is not installed and "android" is not in your PATH phone table

however, I do not know where to place the code that they provide.

I am running OS X.

+6
source share
1 answer

Option 1

for windows

Right-click My Computer β†’ Properties β†’ Advanced System Settings β†’ Environment Variables

Now change the path to system variables to

 ;/yourSdkHome/tools;/youSdkHome/platform-tools 

Option 2

On a Windows machine, open the Open Command command and enter each of these commands one at a time

 set ANDROID_HOME=**C:\\android-sdk-windows** set PATH=%PATH%;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools 

In the MAC machine, open a terminal and enter them one at a time

 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 with the Android SDK path on your computer.

<installation location> should be replaced with the Android SDK path on your computer.

Example

in the MAC machine, if the installation location is ~/adt-bundle-mac-x86_64/sdk

first line should be

 export ANDROID_HOME=~/adt-bundle-mac-x86_64/sdk 
+15
source

Source: https://habr.com/ru/post/980850/


All Articles