Installing Apache Ant on OSX Mavericks for PhoneGap development
I haven't developed any PhoneGap applications on one of my laptops since upgrading it to OSX Mavericks. Earlier this evening I stumbled across a problem when running the following command to run the app against the Android SDK:
phonegap run android
The error is received was:
[phonegap] detecting Android SDK environment...
[phonegap] using the local environment
[phonegap] adding the Android platform...
[error] An error occured during creation of android sub-project.
Error: ERROR : executing command 'ant', make sure you have ant installed and added to your path.
It turns out that Ant isn't installed by default on Mavericks. If you hit this issue too there are two quick ways to remedy the situation and get up and running again.
This is the solution I used as I have HomeBrew installed on this machine.
I updated the Brew and simply requested an install of Ant:
brew install ant
This took seconds to work, which is always a pleasant surprise. If you dont have HomeBrew installed, simply run the following command first:
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)"
If you're a MacPorts user instead, simply run the following:
sudo port install apache-ant
Whichever method you choose, you should now once again have access to Ant via the command line.