Recently learning how to pack the APK on your Mac, cocos2dx the process of installing the JDK and ant today.
First, open the terminal and enter "Java-version"
When you click Enter, the following prompt appears:
The JDK is not installed on our Mac, clicking "More Info" will open the browser, then download the corresponding version of the JDK, here to select "Accept License agreement" before you can download
After the download, install, here directly next to the
After the installation, we re-enter the command to view the results, has been successfully installed
Next is ant, below we still enter the command "Ant-version" in the terminal, also is not installed
We can download the latest version from official website http://ant.apache.org/bindownload.cgi, download the first item here.
After downloading the extract, you need to put the folder in the "/usr/local" directory, the way to enter the directory is as follows:
First open the Finder, then click "Go"--"Go to Folder"
Then enter the path, where the path is only "/usr", the local folder is to create our own
Below we put the previously downloaded Ant folder in the "local" directory
Next open the terminal, get root permissions, we enter the "sudo-s" command, and then enter the administrator password to
When you click Enter, the terminal's prompt will become "bash-3.2#"
We then enter the command "chmod +W/ETC/BASHRC" to modify the permissions of the BASHRC file, and then enter the command "VI/ETC/BASHRC" to modify the file
Press "I" key to enter insert state, insert the following two lines in the file
The path here is the directory where we just placed Ant.
At this point we press "ESC" key to exit the edit state, and then enter ": wq!" (the command in quotation marks), click Enter, save and exit.
Finally, we shut down the terminal. Then, re-open the terminal and enter "Ant-version" again to see the following output, indicating that our ant configuration was successful
Configure the cocos2dx2.2.6 Android environment under Mac