Ant installation when Android project is packaged under Mac

Source: Internet
Author: User


first, ant meaning
ant itself is a process scripting engine that automates calling programs to complete project compilation, packaging, testing, and so on. Ant is written in the pure Java language, so it has a good cross-platform nature. Ant Run is just an XML file (build file), so the operation is relatively simple. Ant can execute various tasks by invoking the target tree. Each task implements a specific interface object. Because the ant build file is a file in XML format, it is easy to maintain and write, and has a clear structure. Because Ant is cross-platform and simple to operate, it is easy to integrate into some development environments.
(A simple understanding of the next, specific can Baidu, the latter may learn more deeply, now know these are good)
      
How is ant going to install it? See a lot of resources on the internet said that the Mac itself with Ant, but the version is low point, I go, really not I pick things ha, I am true wood has found ant trace Ah, has been prompted command not found. So write down their real installation process, to increase their experience, but also hope to help people who need help.
    
Second, install Ant
1. Download:Download website
You can download the zip directly.


2. After downloading, unzip and put into your own set of directories. I put it in the download below, the directory here is mainly used to configure the environment variables need to specify the path, if you are not sure of their own path, you can drag the unpacked package into the browser, the browser's URL bar will show the path address
3, open the terminal to start using the command line to configure the ant environment, terminal open mode (finder--application--utility--terminal)
4. Configure Environment Variables
environment variables are typically configured in/ETC/BASHRC. Global (public) configuration, which will be read by the bash shell, regardless of the way it is executed. (At first, I thought it was ant under the etc, looking for half a day there is no BASHRC file, the last to know that the original is home below)
①, get root permissions
sudo-s
According to the prompt to enter the password, input does not show do not care, enter the end of the return, the prompt will become bash-3.2# ()


②, modify BASHRC read-write permissions
chmod +W/ETC/BASHRC
③, modify BASHRC file
Vi/etc/bashrc
(②, ③ Step)


(/ETC/BASHR command line is mainly I verify the path of BASHRC, no practical significance)
④, enter the edit state of the BASHRC file, add 2 words at the end (after entering the ③ step of the command immediately pop-up)


Note The writing format, the first time in the right and left of the equal sign 2 spaces are not configured successfully said
⑤, press the ESC key to exit the edit state. Input: wq! save and exit.
⑥, test whether the installation is successful
Re-open the terminal and enter Ant-version. If the message is displayed successfully


My ant is finally installed, and I want to say that the command line is really powerful, just look up some simple commands for Mac command line when installing Ant and share it.
1. Get Permission Sudo-s
2, list file ls parameter name Directory name (parameter-w display Chinese,-l details,-a including hidden files) For example: Ls/system/library/extensions (can not write parameters)
3. Convert Directory CD
4. New directory mkdir directory name
5. Copy file CP parameter source file target file (parameter R indicates recursive operation of directory)
6, delete the file rm parameter file (parameter-RF is recursive and mandatory, must be careful to use, if executed RM-RF/your system is all gone)
7. moving files MV File
8. Change file permissions chmod parameter permission file
9, change the file belongs to the main chown parameter user: Group file
10, text editing nano file name (after editing with Ctrl +o save, Ctrl+x exit, another text editing software is VI, the operation is a bit odd, cooked is very useful, and in all Unix-like systems
Tip: Use the Tab key to auto-complement commands


Ant installation when Android project is packaged under Mac

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.