Building an iOS continuous Integration platform (i) Automated build and dependency management

Source: Internet
Author: User
Tags continuous integration tools

2000 Matin Fowler published articles continuous integration "1"; 2007, Paul Duvall, Steve Matyas and Andrew Glover co-authored the continuous Integration:improving Software Quality and reducing Risk "2" published, the book won the 2008-year Turing Award. Continuous integration concept After more than 10 years of development, has become the industry standards. In Java, Ruby's world has developed a very sophisticated continuous integration tool and practice, and for the iOS sector, because technology itself is relatively young and Apple's innate closed mind, the development of continuous integration is relatively lagging, but, as more and more iOS developers influx, And the internet giants to increase the investment in the development of iOS, the birth of a large number of very useful continuous integration tools and services, the purpose of this article is to introduce how to effectively use these classes of libraries, services quickly build a iOS development environment, continuous integration platform.

Automated Build

The build definitions for automation in Martinfowler's article [1] are as follows:

Anyone should is able to bring in a virgin machine, check the sources out of the 
repository, issue a single command, a nd have a running 
system on their machine.

As a result, the first prerequisite for automated building is a command-line tool that supports automated builds, allowing developers to run the current project with a simple command.

Command-line tools

The command-line tools for automated builds are much earlier than the concept of continuous integration, and a few decades ago the Unix world had made, while the Java World had ant,maven and the current most popular gradle. NET world is Nant and MSBuild. Apple, known for its perfect combination of GUI and command-line operations, will certainly not forget to provide a command-line compiler for its closed iOS system: Xcodebuild "3"


Before introducing Xcodebuild, you need to understand some of the concepts "4" in the Xcode environment:

Workspace: In simple terms, Workspace is a container in which you can store multiple Xcode projects you create, as well as files that need to be used in any other project. The benefits of using workspace are, 1, to extend the visual field of the project, that is, to jump between multiple projects, refactor, and one project can use the output of another project. Workspace will be responsible for providing a variety of interdependent relationships between projects, 2, and sharing the build directory between multiple items.

Project: A project that manages all the files and configurations that generate one or more software products, and one project can contain multiple target.

Target: A target is a product built in a project that contains all the files that build the product, and how to build the configuration of the product.

Scheme: A target that defines the build process becomes a scheme. The target build process that can be defined in scheme is: build/run/test/profile/analyze/archive

Buildsetting: Configure the product build setting, say, which architectures to use? Which version of the SDK is used? In Xcode project, there is a project-level build Setting, as well as a target-level build Setting. The build of a product must be targeted for a target, so the build Setting of target is always preferred in Xcode, and if Target is not configured, the build Setting of project is used.

After figuring out these concepts, xcodebuild a good understanding of the role of the official online description of the following:

Xcodebuild builds one or more targets contained 
in a Xcode project, or builds a scheme contained in a Xcode Space or 
Xcode project.

Xcodebuild is the command-line tool used to build the product, and its usage can be summed up in 3 parts:

Objects that can be built

Build behavior

Some of the other auxiliary commands

The objects that can be built are, by default, the first target under project to be run:

Workspace: Must be used with "-scheme" to build a scheme under the workspace.

Project: When you have more than one project in the root directory, you must specify project by using "-project" and then run

Target: Build a target

Scheme: Use with "-workspace" to specify scheme for the build.


Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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: and provide relevant evidence. A staff member will contact you within 5 working days.