The Xcode Plugin runs Xcode command-line tools from Jenkins to build, test, sign, and package applications for Apple platforms, including iOS, iPadOS, and macOS. It can also publish test results in JUnit format.
The plugin provides freestyle build steps to build an Xcode project, import a developer profile, unlock a macOS keychain, and export an IPA from an archive. Pipeline users can access the corresponding steps through the Pipeline Snippet Generator.
- A macOS build agent with a supported version of Xcode and its command-line tools.
- Signing certificates, private keys, provisioning profiles, and keychains required by the build.
- The plugin installed from the Jenkins Update Center.
Configure the paths to xcodebuild, xcrun, and agvtool under Manage Jenkins > System if they are not available at their default locations. To select an installed Xcode version, configure it under Manage Jenkins > Tools, then select it in the build step. You can also set DEVELOPER_DIR for a build.
Store developer profiles and keychain credentials in Jenkins credentials. A developer profile contains signing certificates and provisioning profiles; protect it as a credential because it may include private keys. Configure keychain credentials with the keychain path and password. Use the credential ID in the build configuration where applicable.
The plugin’s keychain operations rely on macOS security services. Avoid running builds that modify or unlock the same keychain concurrently under the same macOS account.
Add the Xcode build step to build a project or workspace. Select the project path, scheme or target, configuration, and SDK as needed. Enable archive or IPA export options only when required. To run unit tests, build the test scheme or target with a simulator SDK and enable JUnit test report publishing in the job configuration. The report pattern is commonly **/test-reports/*.xml.
Use Import developer profile to install a stored profile for signing. Choose whether to import it into an existing keychain or a temporary keychain. Use Unlock macOS Keychain when a build needs to unlock an existing keychain. Use Export IPA to export an archive created by an earlier build step.
The pipeline step names are xcodeBuild, importDeveloperProfile, unlockMacOSKeychain, and exportIpa. Use Pipeline Syntax in Jenkins to select a step and generate a snippet with the parameters supported by the installed plugin version. This avoids relying on outdated parameter lists.
For example, import a developer profile and build an archive:
importDeveloperProfile(
profileId: 'developer-profile-credential-id',
importIntoExistingKeychain: false
)
xcodeBuild(
xcodeSchema: 'MyApp',
configuration: 'Release',
generateArchive: true,
buildIpa: false
)Parameter names correspond to the pipeline step configuration. Available options depend on the selected step; consult the generated snippet for the authoritative list.
- Source repository
- Report a bug
- Suggest an improvement or feature
- Jenkins community mailing lists
- Jenkins community chat
Before opening an issue, search for existing issues. Pull requests are welcome; include the relevant context and steps to reproduce when applicable.
Licensed under the MIT License. See LICENSE.