Help Center/ CodeArts Artifact/ User Guide/ Self-Hosted Repos (New)/ Uploading/Downloading Packages on the Client/ Uploading and Downloading a CocoaPods Package on the Client
Updated on 2026-08-10 GMT+08:00

Uploading and Downloading a CocoaPods Package on the Client

CodeArts Artifact can connect to local CocoaPods clients. You may upload your private packages from your local CocoaPods client to self-hosted repos and share them with others, who can download these CocoaPods packages through their clients.

CocoaPods Pod

CocoaPods is a dependency manager for iOS and macOS projects. It helps developers easily integrate and manage required libraries efficiently.

Constraints

The repository password for a self-hosted repo is account-specific. If you are prompted for a password while using a different account, download the configuration file from the repository's Tutorial tab to obtain it.

Prerequisites

Uploading a CocoaPods Package from the Client

Uploading a CocoaPods package to self-hosted repos by provided configuration file

  1. Access self-hosted repos using your Huawei Cloud account.
  2. In the left pane, click the target CocoaPods repository.
  3. Click Tutorial on the right of the page.
  4. In the displayed dialog box, select Download the provided configuration file and click Download Configuration File to download the cocoapods.txt file.
  5. Obtain {username} and {password} from the downloaded file.
  6. Run the following command on your local client to upload the local CocoaPods package to the target self-hosted repo.

    curl -k -u "<USERNAME>:<PASSWORD>" -XPUT "{url}/<TARGET_FILE_PATH>/" -T <PATH_TO_FILE>/<FILE_NAME>
    • USERNAME: {username} obtained in 5.
    • PASSWORD: {password} obtained in 5.
    • url: repository address of the CocoaPods repository.
    • TARGET_FILE_PATH: name of the self-hosted repo folder to be stored.
    • PATH_TO_FILE: local path of the package to be uploaded.
    • FILE_NAME: name of the self-hosted repo to which the package is uploaded.

  7. Check the uploaded package in the CocoaPods repository.

Uploading a CocoaPods package to self-hosted repos by command-line configuration

  1. Access self-hosted repos using your Huawei Cloud account.
  2. In the left pane, click the target CocoaPods repository.
  3. Click Tutorial on the right of the page.
  4. In the displayed dialog box, select Follow the command line configuration.
  5. Check whether the Ruby client has been installed.

    ruby -v

  6. Install the cocoapods-art plug-in.

    sudo gem install cocoapods-art

  7. Add the self-hosted repo to your CocoaPods client.

    pod repo-art add <repo_name> "{url}"
    • repo_name: name of the folder for storing packages of self-hosted repos on your local client.
    • url: repository address of the CocoaPods repository.

  8. In the Select purpose area, click Publish.
  9. Upload the local package to the target CocoaPods repository.

    curl -k -u "<USERNAME>:<PASSWORD>" -XPUT "{url}/<TARGET_FILE_PATH>/" -T <PATH_TO_FILE>/<FILE_NAME>
    • USERNAME: {username} obtained in 5.
    • PASSWORD: {password} obtained in 5.
    • url: repository address of the CocoaPods repository.
    • TARGET_FILE_PATH: name of the self-hosted repo folder to be stored.
    • PATH_TO_FILE: local path of the package to be uploaded.
    • FILE_NAME: name of the self-hosted repo to which the package is uploaded.

  10. Check the uploaded package in the CocoaPods repository.

Downloading a CocoaPods Package to the Client

Downloading a CocoaPods package by provided configuration file

  1. Access self-hosted repos using your Huawei Cloud account.
  2. Select the target CocoaPods repository from the self-hosted repo page and click Tutorial on the right of the page.
  3. In the displayed dialog box, select Download the provided configuration file.
  4. In the Select purpose area, click Download.
  5. Run the following commands to download files to your local client.

    1. Download the package from the remote repository.
    pod repo-art add {package_name} {url}

    package_name: name of the CocoaPods dependency to be downloaded.

    url: repository address of the self-hosted repo.

    Change the address of the CocoaPods repository.

    pod repo-art update {package_name} {url}

    package_name: The CocoaPods dependency cannot be modified.

    url: enter the repository address of the target self-hosted repo.

    Query the downloaded dependency.

    pod repo-art list

    Remove the local dependency.

    pod repo-art remove <repo-name>//repo_name: name of the CocoaPods dependency

Downloading a CocoaPods package by command-line configuration

  1. Access self-hosted repos using your Huawei Cloud account.
  2. Select the target CocoaPods repository from the self-hosted repo page and click Tutorial on the right of the page.
  3. In the displayed dialog box, select Follow the command line configuration.
  4. Check whether the Ruby client has been installed.

    ruby -v

  5. Install the cocoapods-art plug-in.

    sudo gem install cocoapods-art

  6. Add the self-hosted repo to your CocoaPods client.

    pod repo-art add <repo_name> "{url}"
    • repo_name: name of the folder for storing packages of self-hosted repos on your local client.
    • url: repository address of the CocoaPods repository.

  7. In the Select purpose area, click Download.
  8. Run the following commands to download files to your local client.

    Download the package from the remote repository.

    pod repo-art update {package_name}//package_name: package name.

    Query the downloaded package.

    pod repo-art list

    Remove the local dependency.

    pod repo-art remove <repo-name>//repo-name: name of the CocoaPods dependency