First things first though; verify that you have Java installed on your Mac by typing the following command in the Terminal application (located in Application/utilities):
You should, if Java is installed, see something akin to the following:
If Java is installed then proceed with the following steps, otherwise install Java for Mac OS X 10.9 from the following location: http://www.java.com/en/download/help/mac_install.xml.
- Download the Apache Ant binary (as of writing the current version is: apache-ant-1.9.2-bin.tar.bz2) from the following location: http://ant.apache.org/bindownload.cgi
- Uncompress the downloaded binary package and rename the directory from apache-ant-1.9.2 to ant
- In the Terminal application move the downloaded ant directory with the following command (note you must be logged in as an administrator otherwise you will get an error informing you that you don’t have permission): mv /Users/username/Downloads/ant /usr/share/
- Assuming there were no problems with running this command now type the following into the Terminal: nano ~/.bash_profile to add path environment variables for the recently installed ant directory
- Add the following environment variable to the .bash_profile file: export ANT_HOME=“/usr/share/ant"
- Then, on a new line, add the following environment variable: export PATH=$PATH:$ANT_HOME/bin
- Save the amended file and exit the nano editor
- Now type the following command: source ~/.bash_profile
- Open a new Terminal window, navigate to where your Phonegap project build is located - specifically the platforms directory
- Enter the following command cordova platforms add android
- This might take a few seconds, or slightly longer, but you should now have an android project build directory installed without any errors