Skip to content

New iOS project

Riina Väisänen edited this page May 3, 2017 · 2 revisions

New iOS project with Jenkins

Prerequisites

Install Xcode Plugin for Jenkins in Manage SettingsManage Plugins. Make sure that Git and Github plugins and their depedencies are installed and configured.

If xcodebuild, agvtool or xrun are not installed in the default location, their paths need to be configured in Configure SystemXcode builder.

Configuring the job

  1. Create a new Freestyle job (New ItemFreestyle Project)

  2. Add a git repository for the job in Source Code Management

  1. Configure a build trigger

The project can be built either by setting up a build trigger or clicking the Build Now-button in the job page. It's possible to set up builds with a Github hook (for exaple on push or pull request) or by configuring Poll SCM. For example, the repository can be checked every five minutes with: H/5 * * * *).

  1. Add Xcode as a build step

In General build settings, set the target to build if needed. Set the configuration to Debug or release depending on the project.

In Advanced Xcode build options, a Schema File can be specified. In Custom xcodebuild arguments it's possible to specify extra parameters. For example to test the app following parameters can be added: ”test -destination "platform=iOS Simulator,name=iPhone 6,OS=10.2”

  1. Add creation of JUnit test reports as an task after the build if wanted.

Notice: When building using scheme, make sure that the scheme is shared (ProductSchemeManage schemes), otherwise it will not be added to repository and be visible for Jenkins.

When running tests, in OSX Jenkins needs to be running as its own user or the simulator cannot be started.

Creating .ipa

  1. In Xcode build configuration, in General build settings click advanced and click on the checkbox that says ”Pack application and build .ipa?” and fill the form.

  1. Add archiving of the artifacts into Post-build Actions

  1. The artifacts can be seen on the main page after successful build.

  1. It’s possible to automatically update version number in the Versioning-tab at Xcode build settings.

Signing

With the xcode and credentials plugin the developer profile can be stored in Jenkins. To add the profile to Jenkins go to Configure credentialsApple developer profileAdd.

To use the profile with signing, Import developer profile must be added as a build step before executing xcode build so that the developer profile is installed to the slave machine before.

If the signing is done using certificates, identities and provisions, they must be installed on the build machine separately to be able to sign the ipa file.

Make sure that the project includes screenshots, app icon and other necessities before uploading to the App Store.

The Pipeline

Radiators

Clone this wiki locally