This assumes that you have built the Jenkins environment. Otherwise, please read one of my other articles:
http://my.oschina.net/u/930967/blog/298980
In fact, that article is useful in two words, or directly written here
Jenkins is a Java Web project that can go to the official website to download the war package, which can be run under Tomcat WebApps.
Visit Localhost:8080/jenkins to enter
A command-line tool is available for any development tool. Android, for example, uses Ant. Java has maven. There are also xcode,visual studio and so on, all have the corresponding command line tool. We can completely write a shell script ourselves to complete the package work.
The following commands can be used to package an Android project, and Jenkins actually invokes a similar command
Ant Build-f xxx/build.xml
Jenkins supports a variety of plugins, "networking" can be used after installation, common git plugins, ant plugins, maven plugins and so on.
In the top left corner of the Jenkins home page, click System Management-Admin Plugin
Click on "Optional Plugins" and search for Git, choose to install Git plugin (or a few more like Git client plugin)
Install ant plugin the same way
You may need to restart Jenkins by restarting Tomcat. Programmers, if you encounter a mistake, you can start multiple times.
Click New in the upper-left corner of the Jenkins home page.
Give the project a name and choose a free-style project
If you have not directly entered here, please click on the item and click "Configure" on the left.
It's probably like this.
Source management, choose git, configure login information, specifically, please do their own research.
Hit the "Build" point "Add Build Step" button and select Invoke Ant (if you don't have this option, you don't have the Ant plugin installed, follow the steps above to install the plugin)
Point Advanced, set details (do not understand ant, please do not know how to fill the ant basic knowledge)
Once you've set it up, you're ready to save it.
On the project page, click on the left, and build now. Starting the build, the build history below lists the building histories, the red ball represents the build failure, and the basketball represents success.
In the build history, find the wrong build record, and click to select Console output (or call console outputs) to see the cause of the error.
For my Mac, put it in
/users/***/.jenkins/workspace/reed_android/code/proj.android/bin
It's down.
You can add a build step when the project is configured, choose Execute Shell to execute a shell command, such as executing the file copy command, and putting the generated apk file somewhere else. (for Windows, execute Windows Batch command)