Using Jenkins to build an Android Auto-packaging environment

Source: Internet
Author: User

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

    • Step into the chase

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.

    • Packaging adnroid Items with commands

The following commands can be used to package an Android project, and Jenkins actually invokes a similar command

Ant Build-f xxx/build.xml

    • Installing plugins

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.

    • Create a project

Click New in the upper-left corner of the Jenkins home page.

Give the project a name and choose a free-style project

    • Configuration Items

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.

    • Build

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.

    • Build a workaround after the error

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.

    • Where's the Androbao (APK)?

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)

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.