Skip to end of metadata
Go to start of metadata

Plugin Information

View Xcode integration on the plugin site for more information.

I need your help!!

To help us maintain the plugin, you can take contact to jerome.lacoste at gmail.com in particular if you are able to test upcoming releases

Thank you!

A problem, An idea ?

Please use our tasks and issues tracker to report bugs, improvements or new feature.

Also if you want to propose some code change using a Github pull request, please open also a Jira issue. It is easier for developers to track them.

This plugin adds the ability to call Xcode command line tools to automate build and packaging iOS applications (iPhone, iPad, ...).
Table of Contents

Features

Versioning

This builder can invoke agvtool to dynamically update the CFBundleVersion (a.k.a. Technical Version) or CFBundleShortVersionString (a.k.a. Marketing Version). It supports all macros from the Token Macro Plugin. For example the value ${BUILD_NUMBER} will be replaced with the current build number. We advice you to generate a unique value for each build for the CFBundleVersion if you want for example deploy it into a private store. In that case you can use for example : ${JOB_NAME}-${BUILD_NUMBER}

Building

The target (optional), configuration (e.g. Debug, Release) and SDK (optional) can be specified in the per-project config along with whether to perform a clean before the build phase.

Packaging

The builder can be used to package the .app into a .ipa. Since a .app is actually a directory, it can be awkward to work with and, especially, distribute. We can simplify this by packaging the .app into a single .ipa file, which is just a
zip file with a well-known internal structure

Signing

This plugin has two features that help you simplify the code signing process.

Allowing Jenkins to stage developer profile

This plugin builds on top of Credentials Plugin to allow you to store your Apple Developer Profile (*.developerprofile) file. This file contains a code signing private key, corresponding developer/distribution certificates, and mobile provisioning profiles. You can create this file from your XCode.

To upload the developer profile into Jenkins, go to "Manage Credentials" in the system configuration page, and select "Apple Developer Profile" from the "Add" button. See Credentials Plugin for further details.

To use this profile for signing, add "Import developer profile" as a build step before you run xcode, and select the developer profile to import into the build machine. This build step will install the developer profile into the slave's keychain.

Work with existing populated keychains

If you create a dedicated keychain that stores the code signing private key and certificate on every build slave, you can configure the plugin to just unlock this keychain (so that xcode can use it for signing)

Unlocking

If you store your keys in the user keychain (most probably) and if you run jenkins as daemon, make sure you installed a recent version of jenkins for Mac, or configured the daemon to create a session (through the CreationSession=true parameter in your org.jenkins-ci.plist daemon config file). See also

Timeouts

The keychain has a default timeout of 300 seconds. One can override it using the security set-keychain-settings command, which isn't supported in the plugin today. Support in the plugin could be improved by adding options to modify the timeout as part of the build process. See JENKINS-17184.

Unit Testing

This plugin will listen to the xcodebuild output when running OCUnit or XC tests and write out JUnit-format test reports that Jenkins can understand. Jenkins will then use these to publish test failure reports and graphs.

Sample of the configuration panel

Documentation

Installation guide

Obviously, the build machine has to be an OSX machine with XCode developer tools installed.
Certificates, Identities and Provisions must be installed on the build machine separately.
Just install the latest version of the plugin from the update center and configure a freestyle job (see #Usage Guide) that will use your OSX node (If your central instance isn't running under OSX).
If xcode related binaries aren't stored in the default location, update the global configuration of the plugin (Manage Jenkins -> Configure System)

 

If you want to use multiple versions of Xcode to build your application, use ’Global Tool Configuration’ to register the distinguished name and location of the installed Xcode.

Usage guide
Setting up a build step

Add the XCode build step to a free-style project and set the target (e.g. MyApp), configuration (e.g. Release) and check the build IPA and update version number options. This will give you a single, versioned .ipa file. You can also select to clean the project before a build; while this will make sure that the project is starting from a clean state, it will make large projects take a lot longer.

Setting up a unit test step

Add the XCode build step and this time specify your unit test target (e.g. MyAppTests), configuration (e.g. Debug) and the SDK (e.g. Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/).
Leave all the checkboxes unselected. The SDK needs to be supplied here as the unit tests will only be run when building under the simulator's SDK.
Check the "Publish JUnit test result report" option in the project config and set the value "*/test-reports/*.xml" under "Test report XMLs". This will tell Jenkins to pick up the JUnit-format test reports.

XCode Builder configuration parameters

Parameter

Pipeline Parameter

Since version

Description

Development TeamdevelopmentTeamName1.4

The name of the configured development team to use to sign the package. As of XCode 8.3, this is required now to sign an ipa (which now uses xcodebuilder).

A development team can be configured here by specifying a Development Team ID, or by creating one in the jenkins global configuration.

Development Team IDdevelopmentTeamID1.4The ID of the Apple development team to use to sign the IPA If 'Development Team' is not selected.
Xcode Tools VersionxcodeName2.0.3You can select the version of Xcode set by 'Global Tool Configuration' by plugin setting.
If you choose the 'System Default' for Xcode version, plugin will not do anything, so you can switch Xcode using environment variable 'DEVELOPER_DIR' as well.   
Targettarget1.0The target to build. If left empty, this will build all targets in the project. If you wish to build your binary and the unit test module, it is best to do this as two separate steps each with their own target. This was, the iPhone Simulator SDK can be specified for the unit tests.
Interpret As Regular ExpressioninterpretTargetAsRegEx1.4Build all entries listed under the "Targets:" section of the xcodebuild -list output that match the regexp.     

Clean before build?

cleanBeforeBuild

1.0

This will delete the build directories before invoking the build. This will force the rebuilding of ALL dependencies and can make large projects take a lot longer.

Allow failing build results?allowFailingBuildResults1.4Checking this option will prevent this build step from failing if xcodebuild exits with a non-zero return code.
No Console Log?noConsoleLog2.0.1Checking this option will not log xcode build output to console output.
Logfile Output directorylogfileOutputDirectory2.0.1Specify the directory to output the log of xcodebuild.
If you leave it blank, it will be output to "project directory/builds/${BUILD_NUMBER}/log" with other logs.
If an output path is specified, it is output as a xcodebuild.log file in a relative directory under the "build output directory" 
Configurationconfiguration1.0This is the name of the configuration as defined in the XCode project. By default there are Debug and Release configurations.
Xcode Schema FilexcodeSchema1.2Needed if you want to compile for a specific schema instead of a target, or if you want to generate an archive or an IPA.
Generate Archive?generateArchive2.0Checking this option will generate an xcarchive of the specified scheme. A workspace and scheme are are also needed for archives.
Pack application, build and sign .ipa?buildIpa1.0The target to build. If left empty, this will build all targets in the project. If you wish to build your binary and the unit test module, it is best to do this as two separate steps each with their own target. This was, the iPhone Simulator SDK can be specified for the unit tests.
Export methodipaExportMethod1.4The export method of the .app to generate the .ipa file. Should be one in 'development', 'ad-hoc', 'enterprise' or 'app-store'.
.ipa filename patternipaName1.4A pattern for the ipa file name. You may use ${VERSION} and ${BUILD_DATE} (yyyy.MM.dd) in this string
Output directoryipaOutputDirectory1.4The output directory for the .ipa file, relative to the build directory.
Upload Bitcode?uploadBitcode2.0.3If Checked, include bitcode in IPA exporting for App Store.
The default is "Yes" (check is on).
Upload Symbols?uploadSymbols2.0.3If Checked, include symbols in IPA exporting for App Store.
The default is "Yes" (check is on).
Compile Bitcode?compileBitcode2.0.3If checked, Xcode will recompiling Bitcode and exporting IPA for the non App Store.
The default is "Yes" (check is on).
Thinningthinning2.0.3

Set this to thin the packages for one or more devices in Xcode when exporting IPA by methods other than App Store.

Available options are:

  • <none> (Xcode export non-thinned generic application),
  • <thin-for-all-variants> (Xcode export universal applications and all available thinning variants),
  • Or for a model identifier a specific device (eg "iPhone 7, 1").

The default is <none>.

Pack on demand resources?

embedOnDemandResourcesAssetPacksInBundle

assetPacksInBundle

2.0.3Export settings for non App Store.
If the application is using on demand resources and this item is on, the asset pack is included in the application bundle, so you can test the app without the server hosting the asset pack.
If assetPacksBaseURL is not specified, the default is YES (check is on).
On demand resources asset URL

onDemandResourcesAssetPacksBaseURL

assetPacksBaseURL

2.0.3Export settings for non-App Store.
If the application is using an on demand resource and assetPacksInBundle is not YES, this must be the base URL that specifies the host of the asset pack. This will set up the app to download the asset pack from the specified URL. 
Application URLappURL2.0.3Specify the URL for installing the application when creating the manifest.plist that is necessary when OTA installing the application from Web pages or email.
Display image URLdisplayImageURL2.0.3Export settings for non App Store.
Specify the URL of the image (57 x 57 pixels) of the icon to be displayed when installing the application using manifest.plist.
Full size image URLfullSizeImageURL2.0.3Export settings for non App Store.
Specify the URL of the image (512 x 512 pixels) of the icon to be displayed when installing the application using manifest.plist.
Asset pack URLassetPackManifestURL2.0.3Export settings for non-App Store App.
If the application is using on-demand resources and the application will installing OTA with manifest.plist, this must be the base URL that specifies the host of the asset pack. This will set up the app to download the asset pack from the specified URL.
Strip Swift Symbols?stripSwiftSymbols2.0.5If checked, symbols be stripped from Swift libraries when exporting the application to IPA.
Manifest Plist URLipaManifestPlistUrl1.5

The base URL to use to create a Manifest Plist. If omitted no Manifest Plist will be generated.

Manual signing?manualSigning2.0.1For this option you need to manually specify the combination of Provisioning profile UUID and BundleID.
This will be useful if you want to change the combination of Provisioning Profile and Certificate used for CodeSign when you build the application.
Provisioning Profiles Bundle ID

provisioningProfiles: [
provisioningProfileAppId:]

2.0.1Specify the Bundle ID of the application for which code sign to be performed.
If the location of the Info.plist file contained in the compiled archive is set instead of the Bundle ID, read the Bundle ID from the Info.plist file and use that value.     
Provisioning profiles UUID

provisioningProfiles: [
provisioningProfileUUID]

2.0.1Specify the UUID or Specifire of the provisioning profile to use to sign the application. If the location of the provisioning profile is set instead of the UUID or Specifire, read the UUID from the provisioning profile and use that value.     
Change bundle ID?changeBundleID1.4

Checking this option will replace the bundle identifier. 
You will need to specify which bundle ID (CFBundleIdentifier) to use and where is the Info.plist file located.
This is handy for example when you want to use a different code signing identity in your development projects.

New bundle IDbundleID1.4

The new bundle ID. Usually something like com.companyname.projectname.

Info.plist pathbundleIDInfoPlistPath1.4

The path to the info.plist file which contains the CFBundleIdentifier of your project.
Usually something like:

${WORKSPACE}/ProjectName/Project-Info.plist

Unlock Keychain?unlockKeychain1.0Automatically unlock the keychain before signing the archive?
Keychain namekeychainName1.4The name of the configured keychain to use to retrieve certificates to sign the package.
Keychain pathkeychainPath1.0The path of the keychain to use to retrieve certificates to sign the package (default : ${HOME}/Library/Keychains/login.keychain).
Keychain passwordkeychainPwd1.0The password of the keychain to use to retrieve certificates to sign the package.
Clean test reports?cleanTestReports1.3This will delete the processed test reports before invoking the build. Usually it is a good idea only to do it in test targets, otherwise if other Xcode target is built before tests – the build will fail to collect test reports.

SDK

sdk

1.0

You only need to supply this value if you want to specify the SDK to build against. If empty, the SDK will be determined by XCode. If you wish to run OCUnit tests, you will need to use the iPhone Simulator's SDK, for example: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/

SYMROOT

symRoot

1.1

You only need to supply this value if you want to specify the SYMROOT path to use. If empty, the default SYMROOT path will be used (it could be different depending of your Xcode version). Supports all macros and also environment and build variables from the Token Macro Plugin. For example you can use the value : ${WORKSPACE}/build

Custom xcodebuild arguments

xcodebuildArguments

1.3

Passing custom arguments is convenient when you need to change some project options for Jenkins build, but don't want them to persist in project file. For example when running application tests, following settings often are nice fit: GCC_SYMBOLS_PRIVATE_EXTERN=NO COPY_PHASE_STRIP=NO. Otherwise Release build will usually fail because it won't be able to find application symbols to link with test bundle. Arguments are currently separated by space, enclosing them in quotes won't help.

Xcode Workspace File

xcodeWorkspaceFile

1.2

Only needed if you want to compile a workspace instead of a project. It takes precedence over 'Xcode Project File' setting and this job 'configuration' parameter."

Xcode Project Directory

xcodeProjectPath

1.0

This is the relative path from the workspace to the directory that contains the XCode project file. You only need to supply this value if the XCode project you wish to build is not in the root of the workspace.

Xcode Project File

xcodeProjectFile

1.0

If there is more than one XCode project file in the project path, you will need to specify the file name of the project you wish to build. If you need to build all project, you will need to create an XCode build step for each one manually.

Build output directory

buildDir

1.2

The value to use for CONFIGURATION_BUILD_DIR setting (BUILD_DIR in >= 2.0.0). You only need to supply this value if you want the product of the XCode build to be in a location other than the one specified in project settings and this job 'SYMROOT' parameter. Supports all macros and also environment and build variables from the Token Macro Plugin. For example you can use the value : ${WORKSPACE}/build

Provide version number and run avgtool?provideApplicationVersion1.4Provide version number and run avgtool before invoking the build.

Marketing version

cfBundleShortVersionStringValue

1.0

This will set the CFBundleShortVersionString to the specified string. Supports all macros and also environment and build variables from the Token Macro Plugin.

Technical version

cfBundleVersionValue

1.0

This will set the CFBundleVersion to the specified string. Supports all macros and also environment and build variables from the Token Macro Plugin. For example the value ${BUILD_NUMBER} will be replaced with the current build number. We advice you to generate a unique value for each build if you want for example deploy it into a private store. In that case you can use for example : ${JOB_NAME}-${BUILD_NUMBER}


Using multiple versions of xcode.

One can easily support multiple versions by using environment variables. But first one need to install multiple versions on the build server. Here's one strategy:

install multiple versions of xcode

0. Note current config.

xcode-select -p

1. download xcode DMGs from http://developer.apple.com/downloads/

2. enable install from everywhere (under System preferences / Security)

Without that I had problems installing xcode, without graphical feedback, tested on 10.9.5, freshly booted.

Symptoms were:

  • app not responsive
  • Getting errors like in /var/log/system.log

Someone attempted to start application App:"Xcode" asn:0x0-1b62b61 pid:57656 refs=6 @ 0x7fa5d9f6df40 but it still has _kLSApplicationLockedInStoppedStateKey=true, so it is is staying stopped. : LASApplication.cp #2468 SetApplicationInStoppedState() q=LSSession 100027/0x186bb queue

3. open DMG file, copy app to /Applications. This might take a while.

4. close /Volumes/Xcode (otherwise installation won't start)

5. start Xcode, accept agreement, install missing packages if necessary. This might take a while. Close xcode after GUI opens.

6. move freshly installed Xcode to new path, e.g.

sudo mv /Applications/Xcode.app /Applications/Xcode6.1.app

(I use this so that the xcode app appears with version number under spotlight)

7. reset default xcode-select if necessary (installation might have changed it / reset to /Applications/Xcode.app)

sudo xcode-select -s /Applications/Xcode6.1.app

(Note the part above could be fully automated....)

Select the xcode version at runtime

1. Use EnvInject plugin
2. for jobs that require the non default do something like

DEVELOPER_DIR=/Applications/Xcode6.0.1.app/Contents/Developer

under Inject environment variables to the build process

Select the xcode version at runtime (Version 2.0.3 or later)

1. Register the distinguished name and location of the installed Xcode using ’Global Tool Configuration’.
2. Select Xcode registered in 'Global Tool Configuration' in Job's 'Xcode Tools Version'.

That's it.

FAQ

User interaction is not allowed

When code-signing, a prompt may appear on the build machine asking whether to allow keychain access.
This will block the build with a message like "User interaction is not allowed" until it is dismissed.
Just select 'Always Allow' the first time and it shouldn't need to ask again.

If this prompt is not showing on the build machine, you can force it to appear by running the codesign command that failed from a terminal on the build machine:   /usr/bin/codesign --force --sign "iPhone Distribution: .....

No Xcode folder is set
[sources] $ /usr/bin/xcodebuild -version
xcode-select: Error: No Xcode folder is set. Run xcode-select -switch <xcode_folder_path> to set the path to the Xcode folder.
Error: /usr/bin/xcode-select returned unexpected error.
FATAL: Check your XCode installation. Jenkins cannot retrieve its version.

You probably just installed XCode (by default it is in /Developer) but its path isn't configured. You can fix it with

xcode-select -switch /Developer/

You should now be able to execute xcodebuild. Ex :

host:~ user$ /usr/bin/xcodebuild -version
Xcode 4.2
Build version 4C199
Xcode 4.3

XCode 4.3 changes 2 things that are important for our usage on a slave or a master :

  • Command-Line Tools Are Optional : The command-line tools are not bundled with Xcode 4.3 by default. Instead, they have to be installed using the Components tab of the Downloads preferences panel
  • /Developer No Longer Exists : You may have to reconfigure its path like this:

    sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer/
    

Changelog

Version 2.0.6 (16th Aug 2018)
  • Fixed a bug that key chain was not unlocked properly when importing developer profile to keychain.
  • Added input validation when setting up developer profile loader.
  • Added input validation when setting up export IPA.
  • Fix some bugs.
Version 2.0.5 (9th Aug 2018)
  • More compatibility for Pipeline.
  • Added function to import developer profile into existing keychain.
  • Added a function to set exportOptions.plist an option for deleting Swift symbols when exporting IPA.
Version 2.0.4 (22th Jun 2018)
  • I will display an error message if the developer profile is not loaded.
Version 2.0.3 (18th Jun 2018)
  • Implemented the ability to export IPA files from already compiled archives.
  • JENKINS-50266 : Fix custom xcodebuild arguments not passed through to export archive step.
  • JENKINS-51418 : Fix to always be able to use developer team ID as a parameter regardless of automatic code signature.
  • Fix the Plugin is abnormally terminate if the out of order of lines from Xcodebuild output is changed.
  • Added a function to retrieve necessary information for code signature from compiled archive.
  • Support multiple versions of Xcode without using 'EnvInject Plugin'.
Version 2.0.2 (30th Apr 2018)
  • We released again due to infrastructure related problems, but the contents are the same as Ver 2.0.1
Version 2.0.1 (26th Apr 2018)
Version 2.0.0 (24th May 2017)
Version 1.4.11 (21th September 2016)

Because XXXX happens

  • Fix: Support configurable ID for developer profile (JENKINS-32987)
Version 1.4.10 (20th September 2016)
  • New: Support configurable ID for developer profile (JENKINS-32987)
  • New: Allow the option not to sign the IPA with xcrun (JENKINS-32370)
  • Fix: use textarea for Xcode Build Arguments (JENKINS-30228)
  • Fix: Generating an archive builds the project twice (JENKINS-30362)
  • Fix: Allowed the use of environment variables in plist url (JENKINS-27236)
Version 1.4.9 (23rd September 2015)
Version 1.4.8 (28th February, 2015)
Version 1.4.7 (5th January, 2015)
Version 1.4.6 (16th December, 2014)
  • Fix: broken dSYM packaging (since 1.4.5)
  • Fix: BUILD_DATE does not produce the correct last modified date if built on a slave machine (pull request xcode-plugin/50)
  • Fix: make sure to set provideApplicationVersion properly upon upgrade from per-1.4.1 (JENKINS-26027)
  • New: developerProfileLoader: use show-keychain-info to display job specific keychain information
  • New: support XC test output (JENKINS-19955)
  • New: display warning when simulator SDK selected and IPA about to be packaged (JENKINS-21293)
  • New: document xcodebuildArguments (JENKINS-13930)
Version 1.4.5 (10th December, 2014)
Version 1.4.2 (31st December, 2013)
Version 1.4.1 (30th October, 2013)
Version 1.4 (2nd Oct, 2013)
Version 1.3.1 (27th March 2012)
  • Fix: Custom xcodebuild arguments values are not persisted (JENKINS-12510).
Version 1.3 (20th January 2012)
  • New : Ability to specify custom arguments to xcodebuild (so that values in project file can be overridden). It is needed to specify custom build options to make in-app unit tests work.
  • New : Ability to disable clean up of test reports on per-target level, so that it is possible to run several targets in single job and not mess-up test reports.
  • Fix : The plugin fails by searching for a double .app extension while compressing .dsym (JENKINS-12273)
  • Fix : The plugin fails to delete previous generated IPA results in a failed build (JENKINS-12237).
  • Fix : The plugin fails to set default keychain when using an alternate (non login) keychain (By default the login keychain is the default keychain) (JENKINS-12217).
  • Fix : Restore Java 1.5 runtime compatibility. (JENKINS-12378)
Version 1.2.2 (19th December 2011)
  • Fix : Build IPA fails if the plugin is launched on a remote agent using a relative path for its FS Root directory (JENKINS-12144)
Version 1.2.1 (18th December 2011)
  • Fix : Build IPA switch doesn't work properly for a default Xcode project always results in FATAL error (JENKINS-12089)
Version 1.2 (8th December 2011)
  • New build parameter to specify the build output directory. This overrides the setting in the user's project file, so it will be put into a known directory rather than XcodeDerivedData, etc. This makes it much easier to set up subsequent build steps in Jenkins that do something with the output of the build. It does this by passing the setting CONFIGURATION_BUILD_DIR to xcodebuild if a path is set for this new job config value.
  • Add support for building schemes and workspaces : The plugin now supports two extra configuration parameters xcodeScheme and xcodeWorkspaceFile. The scheme maps to xcodebuild's parameter "-scheme" and the workspace to "-workspace". The scheme takes precedence over the target setting and the workspace takes precedence over the project setting.
Version 1.1 (29th November 2011)
  • Upgrade the token macro plugin to version 1.5.1 to support environment and build variables (JENKINS-11892)
  • New configuration parameter to set the SYMROOT value passed to the build. This parameter accepts environment and build variables and Macros (JENKINS-11813)
  • Various code cleanup and improvements.
Version 1.0.1 (14th November 2011)
  • Minor fix about the default value and the documentation of the keystore path parameter.
Version 1.0 (14th November 2011)
  • Initiated from Ray Yamamoto Hilton's Xcode plugin for Hudson with few changes :
    • It improves jenkins compatibility, and is available in its update center.
    • It uses the Token Macro Plugin to configure values of CFBundleVersion and CFBundleShortVersionString
    • It allows to configure the keychain to use and to unlock it
    • It is ready for internationalization

If you previously used the version provided by Ray you should be able to test this one in parallel as it has a new identity. Also you'll have to reconfigure a large part of it if you want to upgrade thus don't forget to save your settings.

Known issues

T Key Summary Assignee Reporter P Status Resolution Created Updated Due
Loading...
Refresh

67 Comments

  1. By any chances we see support for *.xcworkspaces? I'm using CocoaPods for dependency management, which relies on Xcode workspaces.

    1. It will be with pleasure but even if I am the current maintainer of this plugin I have really few few few knowledge about Apple and iOS development environment.
      Open en issue in our tracker (JENKINS project, xcode component) (http://issues.jenkins-ci.org/secure/IssueNavigator.jspa?mode=hide&reset=true&jqlQuery=project+%3D+JENKINS+AND+status+in+%28Open%2C+%22In+Progress%22%2C+Reopened%29+AND+component+%3D+'xcode') with as many details as you can about the evolution you want. I'll update the plugin with pleasure.

      1. I just discover that the plugin has several pull requests (I didn't study them). One of them is about schemes and workspaces. Isn't it what you are looking for ? https://github.com/jenkinsci/xcode-plugin/pulls

    2. 1.2 release which adds the support for workspaces will be available in few hours.
      Cheers,

  2. I'm unable to install this plugin. I've tried on several different machines, against several different installations, including the latest Jenkins version. I'm on a Mac. Jenkins is on a Mac.

    This is the error i get:
    java.lang.NullPointerException
    at hudson.model.UpdateSite$Plugin.getNeededDependencies(UpdateSite.java:660)
    at hudson.model.UpdateSite$Plugin.deploy(UpdateSite.java:702)
    at hudson.PluginManager.doInstall(PluginManager.java:537)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:282)
    at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:149)
    at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:88)
    at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:104)
    at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
    at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:561)
    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:646)
    at org.kohsuke.stapler.MetaClass$3.doDispatch(MetaClass.java:168)
    at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
    at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:561)
    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:646)
    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:477)
    at org.kohsuke.stapler.Stapler.service(Stapler.java:159)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:45)
    at winstone.ServletConfiguration.execute(ServletConfiguration.java:249)
    at winstone.RequestDispatcher.forward(RequestDispatcher.java:335)
    at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:378)
    at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:95)
    at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:87)
    at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)
    at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)
    at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:47)
    at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)
    at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
    at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
    at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164)
    at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)
    at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)
    at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
    at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)
    at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)
    at winstone.RequestDispatcher.forward(RequestDispatcher.java:333)
    at winstone.RequestHandlerThread.processRequest(RequestHandlerThread.java:244)
    at winstone.RequestHandlerThread.run(RequestHandlerThread.java:150)
    at java.lang.Thread.run(Thread.java:680)

    1. I'm checking with the team. yesterday I released 2 plugins (xcode 1.1 and token-macro 1.5.1) but they don't appear correctly in the update center

      1. It was an infrastructure issue.

  3. Is it possible to use this plugin and build once, and create 2 ipa files signed by 2 different provision profiles?

    Or should this be done using a custom build script.

    1. Like the plugin is written for now I don't thing we could achieve that. The question is how we could propose a configuration for that.
      Even if you have only one project, couldn't you create 2 targets, one per ipa. Then in your freestyle job you add the xcode task 2 times, one with each target.
      (I'm not a xcode developer, my skills are really limited on this subject thus maybe what I propose is stupid)

  4. Hi Everyone,

    First, thanks for creating this, once I get it working smoothly its a life saver.

    I'm having an issue when I check mark the Build IPA thingy. the error I get on the build (the xcodebuild phase runs without a problem) is:Cleaning up previously generate .ipa files
    FATAL: /tmp/OPR/output/AdHoc-Distribution/AdHoc-Distribution does not exist

    What seems to happen (I set my Build output directory to /tmp/OPR/output/AdHoc-Distribution/
    and my configuration is set to AdHoc-Distributionfor some reason, the plugin appends these two looking for an ipa to be placed there while the ipa
    is actually created into /tmp/OPR/output/
    I don't see anywhere in the configuration that I mentioned to clean previous .ipa files or anything like that.
    I've tried various folders for the output but all seem to fail with similar problem.

    I'm attaching the full log if anyone can look at it, would be great,
    thanx!
    --tzurs

    (admin note: I removed the log from this comment, as it was too big and caused page loading issues. For build logs, please use gist.github.com or another pastebin site, etc.)

    1. Hi Tzur,

      I think you are facing the same issue as described at the end of this ticket : https://issues.jenkins-ci.org/browse/JENKINS-11813
      Can you test the latest this SNAPSHOT of the plugin : https://issues.jenkins-ci.org/secure/attachment/21228/xcode-plugin.hpi
      What you describe seems to be conform to the error I saw in the code.
      If it fixes your problem, can you open a new ticket in jira (https://issues.jenkins-ci.org). I'll fix the bug and I'll push a release as soon as I'll have your validation.

      Cheers,

      1. Hey Arnaud,

        thanks for your quick reply, I took your snapshot and it DID THE JOB. I have to disclaimer and say I also

        changed the job name (it had spaces which seems to confuse shells for some reason) but I'm almost sure

        it was your fix that works for me.

        Before I saw your reply I took a clone of the sources to have a look (I'm not super knowledgeable in GIT but I believe I took your branch, not sure how to decide..)

        the construction of folders in the original source does look suspicious. in the clone I took it looks still weird to me, especially around adding stuff to the buildDirectory (.child...) not sure why this is done but I'm guessing you looked into it.

        I'll go ahead and open a ticket if it lets me do it.

        thanks for your help, kudos!

        -t

        1. I didn't push the fix in the master repo of the plugin but yes you identified rightly the origin of the issue. The buildDirectory isn't correctly set if the parameter is defined.
          I'll try to push it and to release the plugin tonight or tomorrow with the fix.
          When you'll have open the issue in Jira, please remove the logs from your previous comment as they are taking several MB and it is hard to display comments because of it.
          thx.

  5. I currently have a need to build the same XCode project multiple times with different Provisioning Profiles and Identities.  Currently, I do this by appending a 'CODE_SIGN_IDENTITY="xxxxxx"' to the 'xcodebuild' command, and '--sign "xxxxxx"' to the xcrun command when packaging the .ipa, where "xxxxxx" is the identity, such as "iPhone Distribution: SomeCompany".  Do you think you could incorporate this into your plugin?

    -Mandeep

    1. Yes I see no problem to add this new option.
      It seems that --sign option in xcrun exists only for XCode 4 ?
      In fact I don't see it in the man page (http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/xcrun.1.html) or with my own command line but I can find various blogs about it.

      arnaud@mbp-arnaud:~ $ xcrun
      xcrun: error: no utility name specified
      
      usage: 
      xcrun [-verbose] [-no-cache] [-kill-cache] [-sdk <sdkroot>] [-log] [-run] <utility> [utility argument(s) ...]
      xcrun [-verbose] [-no-cache] [-kill-cache] [-sdk <sdkroot>] -find <utility> 
      <tool> [tool arguments ...]
      

      Please, can you open an issue for this new feature ?
      I will implement it this week.

      1. Thanks alot!  I've added the request - https://issues.jenkins-ci.org/browse/JENKINS-12151.  AFAIK, the --sign option is not an option to xcrun, but to the tool you run using xcrun, "PackageApplication"

        1. ok. Thx a lot. I discovering iOS devs that's why I have some stupid questions sometimes. Thx for this, I better understand.

  6. If this is not the right forum for my question please redirect me.

    I am trying to use the Xcode builder for a project but I get this output almost immediately (NOTE: myjob is not the real name):

    Working directory is /Users/builder/workspace/myjob.
    [myjob] $ /usr/bin/xcodebuild -version
    Xcode 4.2
    Build version 4C199
    Fetching marketing version number (CFBundleShortVersionString) from project.
    [myjob] $ /usr/bin/agvtool mvers -terse1
    FATAL: java.lang.String.isEmpty()Z
    java.lang.NoSuchMethodError: java.lang.String.isEmpty()Z
    at au.com.rayh.XCodeBuilder.perform(XCodeBuilder.java:195)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
    at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:695)
    at hudson.model.Build$RunnerImpl.build(Build.java:178)
    at hudson.model.Build$RunnerImpl.doRun(Build.java:139)
    at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:461)
    at hudson.model.Run.run(Run.java:1404)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:230)

    My working directory, myjob, has the project directory in it (-----.xcodeproj) and when I run the agvtool command manually in the myjob directory it displays "1.0".  The build machine is a Jenkins slave running SnowLeopard.  Any ideas?

    Thanks.

    1. Hi Stephen,

      It is a "bug", I didn't take care of the Java 5 compatibility of the plugin. I suppose you are using Java 5 on this slave ?
      Can you report a bug please ?
      I will include the fix in the next bugfix release.

      Arnaud

      1. Actually, it is using Java 6:

        worms:~ builder$ java -version
        java version "1.6.0_29"
        Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-10M3527)
        Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02-402, mixed mode)
        worms:~ builder$

        1. Hi Stephen,

          Can you open an issue with all details you have, and logs from agent. it is really strange. I will try to propose a fix before the 1.3 release

          Cheers,

  7. Is there a way to [optionally] set the IPA filename?  I'm building from a SVN tag and would like to set the .ipa filename as "App_$TAG".

    1. Not yet, but feel free to ask for an improvement. It shouldn't be too difficult to do.

  8. Hi,

    I am using this plugin to upload to testFlight an Adhoc build and create a zip of the Release build (so if the testing comes back all good I have a zip file ready to send off). For the Adhoc build, (build step one) I specify the technical version to correlate to the jenkins build_number. The Release build comes after the Adhoc build and has the technical version left blank (so it uses whatever is set)

    But when I tried to send the release build to apple for the first time today, I got an error (see below). Looking in the package, the info.plist for the release build has the technical version number of the Adhoc build instead of what is specified in the code. It looks like the first build step is influencing the second build step.

    Note, this might not be the problem - I have yet to test without setting the Adhoc technical version number). Perhaps I am using the plugin incorrectly, or maybe this is a bug?

    Thanks in Advance,

    Johnny

    Error

    "This bundle is invalid. The key CFBundleVersion in the Info.plist file must be a period separated list of non-negative integers."

  9. The ipa that is being produced has a return character in the name, between the marketing version and the build number. This interferes with shell scripts. Any way to get around this?

  10. How does the commands to perform the codesign get generated within the plugin? I tried searching through the source but could not find the occurrence. I am trying to track down a problem with codesign returning an exit code of 1 when run in the plugin, but working correctly when I run it from a terminal.

  11. I am trying to build a .xcworkspace.

    If I leave the targets blank it tells me that I can't specify -alltargets with a workspace. If I specify a target it tells me I can't specify a target with a workspace.

    1. How can I build an .xcworkspace and put the results in a given folder?

      My old command line was

      xcodebuild -workspace candycrushsaga.xcworkspace ONLY_ACTIVE_ARCH=NO -scheme candycrushsaga -configuration Release 
      xcodebuild -workspace myapp.xcworkspace ONLY_ACTIVE_ARCH=NO -scheme myapp -configuration Release 

      Adding CONFIGURATION_BUILD_DIR='./output' to the command line broke the build and I was hoping that this plugin would come to the rescue.

  12. Hi, we had a perplexing issue with the 'archiving' step failing. I thought the solution may be useful to other people.

    Problem: Unable to create .ipa due to a long target ipa path containing variables.

    Solution: Use a relative path for the location of the Info.plist for all targets.

    Explanation: There was a unit testing target, and the path to the Info.plist file contained the variable $SRCROOT. This caused agvtool to not be able to find the marketing version (CFBundleShortVersionString) in the plist. It could still find the version for the main target, but the 'terse' version of the output, which is used by Jenkins, contained part of the error message which was the full path to the Info.plist which it couldn't find.

    That long path was then appended to the end of the build product filename, which caused the problem! 

    1. Hi Gideon

      I have to setup a continuous environment for iOS apps, but had no knowledge until this morning of iOS development environement ^^.

      So now I have my commit build job up and running, but I'm facing the same issue as you for my release job : when trying to produce the IPA file, SRCROOT variable doesn't get expanded and the zip action fails.

      Problem is, all of my different target settings (and there's a bunch of them) are set using this SRCROOT variable. Is there a way to tell xcode to generate relative path instead of SRCROOT ' kind of path ?

      Thank you.

      EDIT : indeed your solution work : had to remove the SRCHOME in all plist paths for all profiles. Thank you !

  13. Hi,

    I'm trying to version the projects like:

    Marketing Version: <blank, use the project's marketing version>
    
    Technical Version: ${MARKETING_VERSION}.${BUILD_NUMBER}
    

    But the thing is that I can't access the marketing version this way. Is there any way to achieve this? Either by improving the XCode Plugin or by exporting a variable in a previous shell script.

  14. We are pre-testing the builds with xCode 6 and it seems with xcodebuild the clean step sometimes is failing for unknown reasons

    Is it possible to use the xcode plugin to only run the clean step and nothing else?

    I can then create another xcode step that only runs the build without cleaning

  15. Is there a chance someone can answer my question for running xcodebuild from the plugin with the clean command only?

  16. I have installed XCode plugin on Jenkins and figured out how to do the versioning.

    But my requirement is different. I have set marketing version as 00.001.$

    Unknown macro: {BUILD_NUMBER}

    . Let say its the 3rd build. It shows as 00.001.3 but what i need is 00.001.003. How can do this?

    Similarly for Build Number 75 : it should be 00.001.075 And for build number 300 : it should be 00.001.300

    To be more clear, what I want to know is how we can add leading zeros to the

    Unknown macro: {BUILD_NUMBER}

    in Jenkins when setting the Marketing version.

    Please answer if there is any solution available

  17. Hi, I'm using xcode integration plugin 1.4.8 to automate iOS Simulator tests on a Yosemite slave with Xcode 7 installed. I run into the following error:

    08:55:987 IdCard got available 87
    Test Suite 'All tests' started at 2015-09-22 14:08:56.613
    FATAL: Unparseable date: "2015-09-22 14:08:56.613"
    Finished: SUCCESS

    Do you have any idea how to fix this error?

    Thx and best regards,
    Oliver

  18. Hi,

    Can anyone advise me on,

    Continuous Integration for  Xcode Projects (iOS/Swift) using Jenkins on Windows Machine

    Best

    Sheeyam

  19. Lots of PullRequests still sitting open, greater than few months ... any chance of merges??

  20. Hello,

    I want to use the new pipeline system that comes with Jenkins 2.0 and I am migrating all my freestyle jobs that are building iOS apps. Unfortunately I don't see a way to use the Xcode plugin in combination with a Pipeline job. Will there be support? Thanks for your answer.

  21. Hi I'm using Jenkins plugin for a while, and it was ok till now. At the moment I'm woorking on a project which I can not build it with Jenkins. The problem is that, when I try to run the apllication or archive the application in xcode, everything is Ok, and xcode itself can run and archive the project easily. But when I try to build the application with Jenkins, jenkins say that:

    file not found #import <vfrReader/ReaderViewController.h> ^ <unknown>:0: error: failed to import bridging header

    Just to mention, I use pods to get the vfrReader! Any idea? Any suggestion how to solve it?

  22. Is this project dead? Last update is almost a year ago.. I reported issues, which seems to never get solved :-(

    Looks like I have to go back to good old bash, and do the stuff myself :-/

    1. dead ... perhaps not but looking for active maintainers
      Someone proposed to joined the team on the dev mailing list thus I hope he may be able to help.
      It is always important to have such plugin maintained by people who are using them directly and it's not my case anymore.
      I can always apply some quick fixes/PR because I spend a good amount of time on it, but I cannot really more validate these changes thus I'm hesitant to do it blindly.
      All help is welcomed.

      1. Not sure if that was reference to me (or if someone else also pinged the mailing list) ... but yeah, we use it on a daily basis and recently trying to get Xcode 8 going can foresee some needed changes. I still haven't heard back from current maintainer :( 

        1. Yes Brantone B we welcomed you in the team and we were waiting for your identifiers : https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/jenkinsci-dev/riLqERwBdZ4/sMvG9JhmDgAJ
          Jerome and I will appreciate a lot your help
          FYI I just release a version 1.4.10 with few little pending PRs but there are a lot of stuffs to do with this plugin (FYI it doesn't build with more recent jenkins versions and the new plugins parent POM (sad) )

  23. I have a project which has many target in. But different target need different provisioning profile, I specified it in Custom xcodebuild arguments with PROVISIONING_PROFILE_SPECIFIER="xxxxx". But all target build with this provisioning profile. Can I specify different profile on different target?     Best :)

  24. Is there any documentation on how to use this plugin from pipelines (as introduced on v2.0.0)?

    1. Hi John Forrest, the easiest solution is to use the Snippet Generator. You just select the 'step' element and then the XCode build step with the different options you want to use. It will generate something like :

      step([$class: 'XCodeBuilder', allowFailingBuildResults: false, buildDir: '', buildIpa: false, bundleID: '', bundleIDInfoPlistPath: '', cfBundleShortVersionStringValue: '', cfBundleVersionValue: '', changeBundleID: false, cleanBeforeBuild: false, cleanTestReports: false, configuration: 'Release', developmentTeamID: '', developmentTeamName: 'none (specify one below)', generateArchive: false, interpretTargetAsRegEx: false, ipaExportMethod: 'ad-hoc', ipaManifestPlistUrl: '', ipaName: '', ipaOutputDirectory: '', keychainName: 'none (specify one below)', keychainPath: '', keychainPwd: '', provideApplicationVersion: false, sdk: '', symRoot: '', target: 'all', unlockKeychain: false, xcodeProjectFile: '', xcodeProjectPath: '', xcodeSchema: '', xcodeWorkspaceFile: '', xcodebuildArguments: ''])
      
      
  25. Hi,

    Is there any update on JENKINS-42615 ? By when is the fix for the same expected.

    Thanks!

  26. Hi.  I'm trying to put together a pipeline for building a project which has both iOS and macOS targets.  It'd be great if I could use the Xcode plugin for both iOS and macOS Xcode projects, but it looks like the mobile provisioning profiles are the only ones imported right now.

    Is there any plan to add import for macOS provisioning profiles (*.provisionprofile) as well as iOS provisioning profiles (*.mobileprovision)?

     

     

     

  27. Hi,

     

    I have exported the developerprofile from my developers MAC machine (which is also my Jenkins Slave) and have imported into Jenkins credentials. Now when i build my iOS job, following error is encountered for the same.

     

    $ security create-keychain -p ******** "jenkins-WorkApp iOS unSigned Build"
    $ security unlock-keychain -p ******** "jenkins-WorkApp iOS unSigned Build"
    ERROR: Build step failed with exception
    java.lang.NullPointerException
    at java.io.ByteArrayInputStream.<init>(ByteArrayInputStream.java:106)
    at au.com.rayh.DeveloperProfileLoader.perform(DeveloperProfileLoader.java:84)
    at au.com.rayh.DeveloperProfileLoader.perform(DeveloperProfileLoader.java:119)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:736)
    at hudson.model.Build$BuildExecution.build(Build.java:206)
    at hudson.model.Build$BuildExecution.doRun(Build.java:163)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:496)
    at hudson.model.Run.execute(Run.java:1737)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:97)
    at hudson.model.Executor.run(Executor.java:421)
    Build step 'Import developer profile' marked build as failure

     

     

    Please help me with the pointers for the same.

  28. sujit kumar

    Perhaps when registering Developer Profile into Jenkins with "Credentials", it seems that you have failed to load Developer Profile.
    Apparently there seems to be a bug in the Developer Profile registration logic of "Credentials", it will fail frequently to load Developer Profile.

    If the developer profile is loaded correctly, click the "update" button of the registered credentials as shown like attached picture, you should see the summary of the registered developer profile.

     

    Reading was done correctly

     

  29. While using Xcode plugin into pipeline, unable to proceed further due to attached screenshot error. 

    I gave all mandatory fields which is optional as per plugin docs, but in pipeline its mandatory. 

    All help is welcomed. 

     

  30. Unfortunately, Xcode Plugin is not fully compatible with "Blue Ocean Pipeline Editor" for now.
    I am planning to improve compatibility further in the future improvement, but for now please edit Jenkinsfile by yourself and include it in the source tree.

     

    1. Do you happen to have a sample Jenkinsfile? That would be of great help to the team.

      1. Still, completely compatible with Pipeline compatibility has not been completed, but there are snapshots of versions with some modifications.

        https://ci.jenkins.io/job/Plugins/job/xcode-plugin/job/master/55/artifact/target/xcode-plugin.hpi

  31. Pipeline script (Jenkinsfile) Like this. (In this example there is also a Watch OS Extension, so it's a little complicated.)

     

    import au.com.rayh.ProvisioningProfile
    pipeline {
      agent any
      stages {
        stage('import') {
          steps {
            importDeveloperProfile 'Developer'
          }
        }
        stage('prepare') {
          steps {
            sh 'echo /usr/local/bin/pod install'
          }
        }
        stage('build') {
          steps {
            xcodeBuild(
              cleanBeforeBuild: true,
              xcodeSchema: "testapp",
              target: "WatchKit2Test",
              developmentTeamName: "Hoge2Network",
              cfBundleShortVersionStringValue: "1.0.0",
              bundleID: "net.hoge2.watchkit2.testapp",
              configuration: "Release",
              bundleIDInfoPlistPath: "testapp/Info.plist",
              manualSigning: true,
              buildIpa: true,
              generateArchive: true,
              provisioningProfiles: [
                [provisioningProfileAppId: 'net.hoge2.watchkit2.testapp', provisioningProfileUUID: 'WatchKit2 Test App Production'],
                [provisioningProfileAppId: 'net.hoge2.watchkit2.testapp.watchkitapp', provisioningProfileUUID: 'WatchKit2 Test App WatchKit App Production'],
                [provisioningProfileAppId: 'net.hoge2.watchkit2.testapp.watchkitapp.watchkitextension', provisioningProfileUUID: 'WatchKit2 Test App WatchKit Extension Production']
              ],
              ipaExportMethod: "app-store",
              ipaName: "WatchKit2Test",
              ipaOutputDirectory: "Release",
              unlockKeychain: true,
              keychainName: "Default keychain"
            )
          }
        }
        stage('export') {
          steps {
            exportIpa(
              archiveDir: "${WORKSPACE}/build/Release-iphoneos",
              xcodeSchema: "testapp",
              developmentTeamName: "Hoge2Network",
              manualSigning: true,
              provisioningProfiles: [
                [provisioningProfileAppId: 'net.hoge2.watchkit2.testapp', provisioningProfileUUID: 'WatchKit2 Test App AdHoc'],
                [provisioningProfileAppId: 'net.hoge2.watchkit2.testapp.watchkitapp', provisioningProfileUUID: 'WatchKit2 Test App WatchKit App AdHoc'],
                [provisioningProfileAppId: 'net.hoge2.watchkit2.testapp.watchkitapp.watchkitextension', provisioningProfileUUID: 'WatchKit2 Test App WatchKit Extension AdHoc']
              ],
              ipaExportMethod: "ad-hoc",
              ipaName: "WatchKit2Test",
              ipaOutputDirectory: "AdHoc"
            )
          }
        }
        stage('archive') {
          steps {
            archiveArtifacts "build/Release-iphoneos/Release/WatchKit2Test.ipa"
          }
        }
      }
    }
     

    If manualSigning: false (automatic signature), it will be much easier as it does not require setting 'provisioningProfiles:'.

  32. If you set provisioningProfiles in Blueocean's Pipeline editor, it is described in a format quoted with ’${}’ as follows.

    ${[[provisioningProfileAppId: 'net.hoge2.watchkit2.testapp', provisioningProfileUUID: 'WatchKit2 Test App Production'], [provisioningProfileAppId: 'net.hoge2.watchkit2.testapp.watchkitapp', provisioningProfileUUID: 'WatchKit2 Test App WatchKit App Production'], [provisioningProfileAppId: 'net.hoge2.watchkit2.testapp.watchkitapp.watchkitextension', provisioningProfileUUID: 'WatchKit2 Test App WatchKit Extension Production']]}

    If the value is empty it can be written as

    ${[]}

    You should be able to make it blank correctly, so we will fix it in the future.

    1. I tried both the approaches in Blueocean's Pipeline editor but got the same error.

      • Expecting "class java.util.ArrayList" for parameter "provisioningProfiles" but got "${[]}" of type class java.lang.String instead

       

      1. I also faced the same problem.
        Apparently, when reading and editing the Jenkinsfile already in the project, validation of Pipeline Editor works normally,
        but it seems that validation of Pipeline Editor does not work properly when trying to make a whole new pipeline script.
        Perhaps I think this is a bug in Pipeline Editor.
        I am not a developer of Pipeline Editor, but I am currently working on tracking down the cause.
        In the meantime, once you have committed an empty pipeline script like the following to the repository, edit it and change the value.

         

        pipeline {
          agent any
          stages {
            stage('') {
              steps {
                xcodeBuild()
              }
            }
          }
        }
        1. Thanks for the quick response.

          I've tried following script in Jenkinsfile. But we are getting the below error.

            • ARCHIVE FAILED **
              The following build commands failed:

          CompileSwift normal armv7

          CompileSwiftSources normal armv7 com.apple.xcode.tools.swift.compiler

          Here is Jenkinsfile:

          Jekinsfile.rtf

          Is Xcode plugin is compatible with cocoapods? 

           

          1. As a project to import framework using cocoapod, I built a sample program of the following URL with pipeline script, but it was able to build without any problems.

            https://www.raywenderlich.com/156971/cocoapods-tutorial-swift-getting-started

             

            pipeline {
              agent any
              stages {
                stage('import') {
                  steps {
                    mportDeveloperProfile 'Developer'
                  }
                }
                stage('prepare') {
                  steps {
                    sh '''/opt/local/bin/pod install
            '''
                  }
                }
                stage('build') {
                  steps {
                    xcodeBuild(xcodeSchema: 'IceCreamShop', target: 'IceCreamShop', generateArchive: true, buildIpa: true, configuration: 'Release', xcodeWorkspaceFile: 'IceCreamShop', developmentTeamID: 'XXXXXXXXXX', unlockKeychain: true, keychainPath: 'login.keychain', keychainPwd: 'password')
                  }
                }
              
            }


            Since I have not seen your program, it is unknown whether or not it corresponds to it, but since I found the following article, please refer to it.

            "xcode CI on Jenkins, XcodeBuild:following build commands failed:"

            https://forums.developer.apple.com/thread/95268

             

            "Build fails on Xcode 9 / macOS High Sierra (both for Swift 3.2 and 4.0)"

            https://github.com/Carthage/Carthage/issues/2226

             
  33. Got ** EXPORT FAILED ** on Xcode 9.4.1 / macOS High Sierra

    Have tried re-login the developer account.

     

    Error Domain=DVTPortalServiceErrorDomain Code=1100 "Your session has expired. Please log in." UserInfo={payload=<CFBasicHash 0x7f8cadfddcd0 [0x7fff96d73af0]>{type = mutable dict, count = 9,

     

    Any idea?

    Thanks

  34. In addition to this problem, I know that various problems are occurring in the Xcode Integration Plugin due to the strengthening of macOS security logic.
    I can not promise to respond because of the convenience of the Apple side, but I want to deal with this problem as much as possible.
    In the meantime, please try self-solving by relying on the following information. (or using manual signing)

    https://stackoverflow.com/questions/33445745/xcode-export-upload-error-your-session-has-expired-please-log-in

    https://github.com/fastlane/fastlane/issues/5384

    https://forums.developer.apple.com/thread/87607

    And if anyone knows a good way to solve this, please let me know.

     

  35. I have the following setup:

    iOS build slave
    In Jenkins:

    • Global configured keychain referencing a keychain on my slave
    • Freestyle Job with:
      • Build Environment > Mobile Provisioning Profile
      • Import developer Profile step
        • Import into global configured keychain
      • Xcode build step
        • Manual Signing
        • Unlock Keychain (global referenced configuration)

     

    And I got ** ARCHIVE FAILED ** when

    /usr/bin/codesign '--force' '--sign' '1C4E0B9EA076E4E1A3111A75311EBEF29600F50D' '--verbose' '/Users/jenkins/Library/Developer/Xcode/DerivedData/Todo-bxlesxjxexbqnudsqyqrqcglgziv/Build/Intermediates.noindex/ArchiveIntermediates/Todo/InstallationBuildProductsLocation/Applications/Todo.app/Frameworks/libswiftCore.dylib'
    /Users/jenkins/Library/Developer/Xcode/DerivedData/Todo-bxlesxjxexbqnudsqyqrqcglgziv/Build/Intermediates.noindex/ArchiveIntermediates/Todo/InstallationBuildProductsLocation/Applications/Todo.app/Frameworks/libswiftCore.dylib: replacing existing signature
    /Users/jenkins/Library/Developer/Xcode/DerivedData/Todo-bxlesxjxexbqnudsqyqrqcglgziv/Build/Intermediates.noindex/ArchiveIntermediates/Todo/InstallationBuildProductsLocation/Applications/Todo.app/Frameworks/libswiftCore.dylib: errSecInternalComponent
    error: Task failed with exit 1 signal 0 {
    /usr/bin/codesign '--force' '--sign' '1C4E0B9EA076E4E1A3111A75311EBEF29600F50D' '--verbose' '/Users/jenkins/Library/Developer/Xcode/DerivedData/Todo-bxlesxjxexbqnudsqyqrqcglgziv/Build/Intermediates.noindex/ArchiveIntermediates/Todo/InstallationBuildProductsLocation/Applications/Todo.app/Frameworks/libswiftCore.dylib'
    }

     

    When I change my configuration, remove the "Import developer profile step" and unlock my default login.keychain on my slave, the build is successful.

     

    Is there something I missconfigured in my setup?

    I really would like to store all required informations in my Jenkins, so I don't have to manage the build slave and update or install any profiles on it.

     

    Regards

    1. Looks like my referenced keychain on the build slave was not correctly unlocked.

       

      After I executed the xcodebuild command, several popups occured where I was requested to enter the keychain password.

      Does anybody knows, if this happens whenever a new identity is about to be added to the keychain? Or only now the first time usage of it?

    2. Version 2.0.6 fixes the logic associated with importing developer profiles and unlocking keychains.
      If you useing the certificate as "Automatically manage signing", it can not be processed normally, but the defects in other cases may be corrected.

Write a comment…