Skip to main content

Cocoapods Install

Runs the CocoaPods install command for dependency management. This step installs all pod dependencies. Appcircle uses the pod install command to install pods in the project. This command comes from the CocoaPods tool installed on the system. If a version is not specified for CocoaPods, this step will use the version of CocoaPods installed on the system.

Prerequisites

Before running the Cocoapods Install step, you must complete certain prerequisites, as detailed in the table below:

Prerequisite Workflow StepDescription
Git CloneThe repo needs to be cloned in order to start the CocoaPods installation process. After the clone, CocoaPods will be installed. After this step works, the variable $AC_REPOSITORY_DIR will be created.
Screenshot

Input Variables

This step contains some input variable(s). It needs these variable(s) to work. The table below gives explanation for this variable(s).

Screenshot
Variable NameDescriptionStatus
$AC_PROJECT_PATHSpecifies the project path. For example: ./appcircle.xcodeproj. If you filled in Configuration => Project or Workspace, this variable comes from Configuration.Required
$AC_REPOSITORY_DIRSpecifies the cloned repository directory. This path will be generated after the Git Clone step.Required
$AC_COCOAPODS_VERSIONSpecifies the CocoaPods version. If there is a specific version you want to use, give it here as hardcoded, and the system will automatically install the given version.Optional
info

Please note that the CocoaPods Install step uses the default system CocoaPods version. If you want to use a specific version, please enter it hardcoded in the CocoaPods Version parameter in the step.

danger

Remember, if the project extension is not .xcworkpace, the pod install step will not work as expected. In the Configuration tab, make sure that the extension in the project path is .xcworkspace.


To access the source code of this component, please use the following link:

Preview of GitHub - appcircleio/appcircle-cocoapods-component


FAQ

How do I manage iOS dependencies with artifactory repository manager?

Integrating an Artifactory repository manager into your iOS build process is a robust approach to centralizing dependency management, improving build reliability, and ensuring reproducibility. Below, we’ll demonstrate this process using Sonatype Nexus Repository Manager as an example in conjunction with the Appcircle CocoaPods Install workflow step. Please ensure your Sonatype Nexus Repository Manager is properly installed and configured. For more information, please visit the official Sonatype Sonatype Nexus documentation.

Supported Frameworks

Sonatype Sonatype Nexus only supports CocoaPods for iOS. There is no support for Carthage and SPM (Swfit Package Manager).

For more information about supported frameworks, please visit [Sonatype Sonatype Nexus Repository documentation](

Preview of help.sonatype.com
Nexus-repository.html).

Configure Sonatype Nexus Repository Authentication

If anonymous access option is turned off in Sonatype Nexus repository, you need to authenticate to the repository with the Authenticate with Netrc step or by using a Custom Script. If Custom Script is used, you can use the bash scirpt given below.

For more information, please visit the Sonatype Nexus Authentication documentations.

$cat ~/.netrc
machine https://Sonatype Nexus.example.com/repository/cocoapods-specs.git
login admin
password admin123

For more information about Sonatype Nexus integration with CocoaPods, please visit the Sonatype Nexus CocoaPods documentations.

Example 1: How can I fetch the all dependencies from Sonatype Nexus with CocoaPods?

In the CocoaPods Install step, in order to pull dependencies from Sonatype Nexus or another artifactory, you need to make some changes in the Pods file. For this, the source url value of the Pods file in the project must be replaced with the relevant artifactory. A short example is shown in the following bash script.

HTTPS Protocol

When configuring Sonatype Sonatype Nexus, you should pay attention to the https protocol. Sonatype Nexus does not support http protocol. Therefore, the source URL must be in https protocol.

SSL Configuration

If you are using a Self-Signed https protocol, this certificate must be secure. If the certificate is not secure, some action should be taken.

For detailed information, please visit the Sonatype Nexus SSL Configuration documentations.


platform :ios, '13.0'
source 'https://Sonatype Nexus.example.com/repository/cocoapods-specs.git'
target 'MyApp' do

use_frameworks!

pod 'AFNetworking', '~> 4.0'
pod 'Alamofire', '~> 5.4'

end

.
.
. #Other Pod file codes

Example 2: How can I fetch some dependencies from different repositories?

If you want to fetch a dependency from a source other than this artifactory, you can set up your Pod file as shown below. This Pod file will pull any pods that are explicitly referenced from the specified URL, while all other dependencies will be retrieved directly from the default source URL.


platform :ios, '13.0'
source 'https://Sonatype Nexus.example.com/repository/cocoapods-specs.git'
target 'MyApp' do

use_frameworks!

pod 'AFNetworking', '~> 4.0'
pod 'Alamofire', '~> 5.4'
pod 'MyPrivatePod', :git => 'https://git.mycompany.com/MyPrivatePod.git', :branch => 'main'

end

.
.
. #Other Pod file codes

After these changes;

  • Trigger your build through Appcircle. The workflow will fetch dependencies from the Sonatype Nexus repository as configured and compile the project with them.
  • Logs will show dependency resolution status to confirm successful integration with Sonatype Nexus.