IOS uses jenkins for continuous integration article 2, iosjenkins

Source: Internet
Author: User

IOS uses jenkins for continuous integration article 2, iosjenkins

In the previous article, I tried continuous integration without in-depth research. In the past two days, I have learned more about the continuous integration environment and internal release systems for the company.

This article mainly introduces other things and does not repeat the content of the previous article.

If jenkins is used for continuous ios integration, xcode plug-in is required. Therefore, you must first download the xcode plug-in and later use the ftp service and install the ftp plug-in.

In jenkins, you can create a specific view group by yourself. Click "+" in the "all" view to create a new view. After the view is created, the edit view option on the left will go to the details page, you can select the task to be placed in this view. Compared with the task, I think it is best to store the code in different versions based on the svn address of the Code. Therefore, our task also points to a version, I am the version number for task differentiation, for example, xxx_iphone_dev_2.5.0.



The following describes some configurations in the IOS task.

1. Select discard old build to clear the build folder.

2. Source Code Management, generally using Subverison,

Respository url, which is used to set the svn address of your code and control which folder to access.

Local module directory (optional), which allows you to set the custom directory where code is stored in the Local workspace. If no code is written, the code is directly stored in the current workspace directory. If the custom directory is set, the directory structure is created in the workspace,

Then the code is stored in this directory.

Source code management allows you to download code from multiple addresses and click add more locations ....

For more information, see the figure.


Different codes are downloaded to different directories. The actual file structure is shown in.

Generally, the code checkout policy should be updated.


3. If the trigger is not added, you can set the number of trigger builds every day. This is better, depending on your needs.

4. Added xcode Build Steps

Pay attention to the type of your xcode project and the svn address.

Generally, if your project is a single project, write a target in the project as follows,



Pack the ipa package and write the ipa package name. Do not add it. ipa and jenkins are automatically added and output directories. Here, we need to describe that many jenkins files must match the correct directory structure. You can check the jenkins job execution log to see where errors occur. For more information, see

Actual physical file,/Users/xxx/. jenkins/workspace/job name /. (. Starts with a hidden file. Generally, mac users will show the hidden file to the system ).

5. Signature

Enter a full name for the signature. Do not fill in the description file below. Otherwise, an error is reported, provided that the target of your program needs to set a signature certificate that can be recognized by the project. Be sure to properly identify the signature, the configuration of a non-existent description file may not work.


6. xcode Advanced Configuration

Because our project is a workspace rather than a single project, it is useless to directly configure the target.


Note that if you are using a mac computer running jenkins, you need to execute a program to generate the scheme of the current computer user, then upload it to svn, and then download it again, the user's scheme exists. Otherwise, the svn code will not be able to build successfully without the user's scheme. The error is that the current workspace does not have xxx scheme.

Xcode scheme file: Enter the program's scheme.

SDK: Enter the sdk supported by the xcode app connected to your current xcode command line. If you have not paid attention to the command line,

HaiwangdeMac-mini: VANCL hai $ xcodebuild-version

Xcode 6.0

Build version 6A313

This indicates that xcode6.0.

HaiwangdeMac-mini: VANCL hai $ xcodebuild-showsdks

OS X SDKs:

OS X 10.9-sdk macosx10.9


IOS SDKs:

IOS 8.0-sdk iphoneos8.0


IOS Simulator SDKs:

Simulator-iOS 5.0-sdk iphonesimulator5.0

Simulator-iOS 6.0-sdk iphonesimulator6.0

Simulator-iOS 7.1-sdk iphonesimulator7.1

Simulator-iOS 8.0-sdk iphonesimulator8.0

This indicates the sdks currently supported by xcode. If you connect xcode5 to the command line and enter iphoneos8.0 In the SDK, an error is returned.

HaiwangdeMac-mini: VANCL hai $ xcode-select-p

/Applications/Xcode 6.0.app/Contents/Developer

The last command shows where your command line is connected.

Usage: xcode-select [options]


Print or change the path to the active developer directory. This directory

Controls which tools are used for the Xcode command line tools (for example,

Xcodebuild) as well as the BSD development commands (such as cc and make ).


Options:

-H, -- help print this help message and exit

-P, -- print-path print the path of the active developer directory

-S <path>, -- switch <path> set the path for the active developer directory

-V, -- version print the xcode-select version

-R, -- reset to the default command line tools path

You can use xcode-select-s <path> to reset the address of the command line connection and set the xcode version to which you connect.
Xcode workspace file specifies where your workspace is. When multiple svn addresses are used, you need to configure different workspaces for each xcode build. It may be 2.5.0/xxx, or 3.0.0/xxx. build output directory, and the results of your task build will appear in this directory structure. Your program's app also contains the packaged ipa package and plist files.
In xcode build, you can create multiple xcode build processes, and then create different packages. 6. Post-build operations-generally, emails are set to receive build failure reports. Let's talk about system management. Here we set a lot of things. Well, let's talk about other things. Set the number of executors to run simultaneously. Default view: Default view. Jenkins url must be configured for jenkins Location. The jenkins service address of this machine is http: // 10.8.53.131: 8080 /. System Administrator email address, enter vancl_ios_jenkins <xxxxx@xxx.com>
Subversion generally Selects 1. 7. mail Notification. You need to set the SMTP server.

Note that there is a selection box below. By sending test mail test configuration, you can set a mail recipient to test whether the mail can be sent successfully.

7. ftp upload service

In the previous article, we had a software lion weak, which enabled the ftp function of the computer.

Set ftp parameters in system settings


I uploaded it to the local device.

Then the results are published to the ftp server.

I am directly sent to the publishing system under my tomcat directory.



Note that flatten files is generally selected. In this case, the directory structure under the Source path you upload will not be uploaded to Destination together, but will only upload the corresponding files; if not selected, in the Destination directory structure

The Source directory structure is created again, which is uncomfortable.

Here we will talk about how to directly download and install things on your mobile phone.


You can directly generate the plist file when creating the ipa package. Enter the plist url as your service address, this address and the file name form the http service Address url for downloading the ipa package. In this plist url, jenkins automatically adds the ipa file name.

The task is successfully executed and uploaded to the ipa and the corresponding plist In the tomcat directory through ftp. Open plist and you can see that its software value points to the corresponding ipa package.


8. After these packages and files are uploaded successfully, set tomcat.

A new simple web service is available, and the index.html on the first page is changed.

Add download link

[Html]View plaincopy
  1. <A href = "./static/vancl_iphone_app/3.1.0/VANCL-Online-3.1.0.ipa"> VANCL-Online-3.1.0.ipa </a>
And direct installation Link

[Html]View plaincopy
  1. <A href = "itms-services ://? Action = download-manifest & url = http: // 10.8.53.131: 8088/static/vancl_iphone_app/3.1.0/VANCL-Online-3.1.0.plist "> install </a>
Since ios7.0 and later require https support from the server, it is not necessary to directly download and install it.

You can use keytool to create a certificate, put it under tomcat, and modify server. xml. However, after the certificate is completed, it cannot be downloaded.

If you use http, the system prompts that the certificate is invalid when you install 7.0. If you use https, the system prompts that you cannot connect to the IP address. It seems that you need an authoritative certificate. You can check whether the certificate is placed on the company's server.

After index.html is modified, tomcat can be started to access this service.




Previous: http://blog.csdn.net/monkey_cool/article/details/38010471


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.