Continuous Integration (CI) : A process that can be built automatically, code compiled automatically, and distributed, deployed, and tested automatically.

A, install,

Let’s start installing Jenkins, the old version no longer supports package download, the new version is officially recommended to use BREW installation

You are advised to uninstall and reinstall it

/ / into the following directory, and then double-click run clear all information/Library/Application Support/Jenkins/Uninstall.com mand Jenkins

// Brew installed, you can execute the following command

  • Uninstall: Brew Uninstall Jenkins
  • Install: Brew install Jenkins
  • Start: Brew Services start Jenkins
  • Brew Services restart Jenkins
  • Update: Brew Upgrade Jenkins

After installation, Safari will probably open automatically. If it doesn’t, open your browser and type localhost

An error may be reported at this point. If there’s a problem with that. The cause of this problem is that the Java environment is faulty.

At this point, if you reboot your computer, you’ll find that Jenkins has given you a new user name, Jenkins, but you don’t know the password. You might try the password, but it must be wrong, because the initial password is very complicated. The correct way to do this is to open localhost and you will see the reset initial password screen shown in the following figure.

According to clew, find/Users/Shared/Jenkins/Home/the directory, this directory is Shared directory, but there are permissions, the Jenkins user/secrets/directory is not to read and write access. Right-click [Display Introduction] and click 🔒 in the lower right corner of the popup window to add the current user rights.

Open the initialAdminPassword file and copy the password to a web page to reset the password. The following figure

Install it all the way through, enter your username, password, email, etc., and call it complete.

Go to localhost:8080 and select “Manage Jenkins” — “Manage Plugins”. We need to install some helper plug-ins first.

Two, install plug-ins, some plug-ins may have the system does not need to install.

1. Keychains and Provisioning Profiles Management
2. Xcode integration
3. Ant Plugin
4. Command Agent Launcher Plugin
5. description setter plugin
6. Email Extension Template Plugin
7. fir-plugin
8. Git Parameter Plug-In
9. GitHub Branch Source Plugin
10. Gradle
11. Pipeline: GitHub Groovy Libraries
12. Project Description Setter
13. Upload to pgyer
14. Workspace Cleanup

With this installed, we can configure the global parameters.

Select Manage Jenkins — Configure System
1. Find “Jenkins Location”
  • Set Jenkins URL to http://127.0.0.1:8080/ for IP access
  • Set System Admin E-mail address to ****@.com by default
2. Find “Global Properties”

Open the “Environment variables”

  • Configure “List of Variables”

“Name “:”PATH” “Value”:”**********” // Enter” echo $PATH “on the terminal to copy all PATH values. Solution pod: Command not found

3. “Xcode Builder”
  • Configuring Aple Development Teams

Open keychain: Copy

  • Find the production certificate: “Apple Distribution:…… (…) “
  • Find the development certificate:

“IPhone Developer:… (…) “Or” Apple Development:…… (…) “

  • Paste into “Team name”, “Development Team ID” is the parameter in parentheses behind
4. Find the “Git Plugin”
  • Global Config user.name Value: Github Name
  • Set Global Config user.email Value to Github email.
  • // Configure the “Subversion” version
5. Find “Extended E-mail Notification” and you may not need to install the plug-in
  • Set SMTP server: SMtp.163.com to email address 163. If the email address is another email address, go to the recipient email address configuration method
  • Set Default user E-mail suffix to ****@163.com // email address
  • Configure Default Recipients: ****@163.com // Email address
6. Find “E-mail Notification”
  • Set SMTP server: SMtp.163.com to email address 163. If the email address is another email address, go to the recipient email address configuration method
  • Set Default user E-mail suffix: @163.com // Email suffix

4. Set office parameters, including key string, Apple package certificate, and certificate description file

Select “Manage Jenkins” — “Keychains and Provisioning Profiles Management”
1. Find the Keychains folder under “~/Library/Keychains/”

Click Select File – find “login.keychain” and click Upload upload.

2. To find “Keychains”
  • Set Filename to login.keychain.
  • Set Password to computer login Password.
  • Configure “Description” : “Keychain”
3. The configuration “Identities”
  • Configure the “Code Signing Identity” : “Apple Distribution:…… (…) “// A release is enough
  • Configure “Code Signing Identity” : “Apple Development:…… (…) “
  • Configure the “Code Signing Identity” : “iPhone Developer:…… (…) “
  • Click “Add Code Signing Identity” to Add multiple certificates
4. Find “Provisioning Profiles”
  • Configuration “Provisioning Profiles Directory Path” : “/ Users/Shared/Jenkins/Library/MobileDevice/Provisioning \ Profiles” / / write dead, don’t change
5. Finally, the most important copy files.
  1. Path: ‘/ Users/Shared/Jenkins/”
  • ⚠️ because all permissions on certain files are closed in the shared path.
  1. Find “/ Users/Shared/Jenkins/Home/kpp_upload/” login, keychain, modify permissions shut everyone, prohibit external personnel access, add the machine user permissions

  2. Find “/ Users/Shared/Jenkins/Home/workspace”, packaging project location

  3. Find “/ Users/Shared/Jenkins/Library/Keychains”, “Keychains” may not create, modify permissions shut everyone, prohibit external personnel access, add the machine user permissions

  • Paste the login.keychain and login.keychain-db files copied from ~/Library/Keychains/
  1. Find “/ Users/Shared/Jenkins/Library/MobileDevice”, “MobileDevice” may not create, modify permissions shut everyone, prohibit external personnel access, add the machine user permissions
  • Paste the Provisioning Profiles folder copied from the ~/Library/MobileDevice/ path.

Create a project

1. Select New Item and click the image to finish

2. On the top menu, click General

3. Configure Source Code Management on the top menu

  • Name of “Branches to build”
4. Configure from the top menu “Build Triggers”

  • Poll SCM Polling query, time timer, timing query ‘H 20 * * *’ every morning at 8:00
5. Configure “Build Environment” on the top menu

  • The first time to create is no information, you need to click the save button, edit again.
  • “Code Signing Identity” selects the packaged certificate name
6. Top menu “Build” configuration

1. Add shell and configure pod Install

#bin/bash cd ${WORKSPACE}/ export LANG=en_US.UTF-8 export LANGUAGE=en_US.UTF-8 export LC_ALL=en_US.UTF-8 pod install pod  update --verbose --no-repo-updateCopy the code
2. Add Xcode and configure xOCde compilation information

  • Select Pack Application, build and sign.ipa?

  • Write die path path: / Users/Shared/Jenkins/Library/Keychains/login. Keychain
  • The password is the computer password

  • Recommend writing
  • “Output directory” /Users/Shared/Jenkins/Home/workspace/build
  • “Build output directory” /Users/Shared/Jenkins/Home/workspace/build
  • Project files: fixed position/Users/Shared/Jenkins/Home/workspace /…
7. Configure post-Build Actions on the top menu

  • Fir. Im automatically uploaded
  • Pgyer automatically uploads
1. Fir. Im, token go to the official website to find

2. Pgyer, uKey api_key Go to the official website

  • Recommended parameter
  • *.ipa
  • /Users/Shared/Jenkins/Home/workspace/build/qrcode.png
  • /Users/Shared/Jenkins/Home/workspace/build/envVars.txt
  • Password (optional) The password is set to remember
  • Android Configuration method
  • Refer to the link
  • Build Android continuous integration platform with Jenkins+Docker
  • Continuous integration with Android using Jenkins under MAC osx