SDKs overview

Bitrise, a mobile-first Continuous Integration and Continuous Delivery (CI/CD) platform, offers a primary Software Development Kit (SDK) in the form of its Command Line Interface (CLI). This CLI is designed to provide developers with tools for local interaction with Bitrise's build system and API. It allows for the testing of Bitrise build configurations on a local machine, enabling faster iteration and debugging of CI/CD workflows before committing them to the cloud platform.

The Bitrise CLI supports a range of functionalities crucial for mobile development pipelines. Developers can use it to validate bitrise.yml configuration files, trigger builds, manage secrets, and run Bitrise Steps locally. This local execution capability is particularly valuable for complex mobile projects, where build times can be significant, as it reduces the dependency on cloud-based builds for initial testing and development of CI/CD scripts. The CLI is compatible with macOS and Linux environments, catering to the common development setups for iOS and Android applications.

While the Bitrise platform is extensively used for mobile app development teams, streamlining iOS builds and automating Android builds, the core interaction point for programmatic control and local testing is the CLI. The platform's ecosystem also includes a wide array of pre-built Steps and integrations, which, while not traditional SDKs, serve a similar purpose by abstracting complex tasks into reusable components within the CI/CD workflow. These Steps often wrap underlying SDKs or tools for specific mobile development frameworks or services, such as Fastlane for iOS deployment or Gradle for Android builds. For detailed information on Bitrise's capabilities, developers can consult the official Bitrise DevCenter documentation.

Official SDKs by language

Bitrise's primary official SDK is its Command Line Interface (CLI). While it is not strictly language-specific in its application, it is implemented in Go and provides a universal interface for interacting with the Bitrise platform. The CLI is designed to be used from any shell environment, making it accessible regardless of the mobile app's native language (e.g., Swift/Objective-C for iOS, Java/Kotlin for Android, or JavaScript/TypeScript for cross-platform frameworks).

Here's an overview of the official Bitrise CLI:

Language/Platform Package/Tool Maturity
Go (CLI Implementation) Bitrise CLI Stable

The Bitrise CLI is maintained by the Bitrise team and is actively developed to support new features and improvements in the platform. Its stability ensures reliability for production CI/CD pipelines. Developers can find release notes and updates on the Bitrise CLI GitHub repository.

Beyond the CLI, Bitrise also provides a comprehensive API that allows for programmatic interaction with the platform. While not a traditional SDK, developers can use any language with HTTP client capabilities to integrate with the Bitrise API reference. This enables custom integrations, advanced reporting, and automation beyond what is directly available through the UI or CLI.

Installation

The Bitrise CLI can be installed on macOS and Linux systems through various methods. The recommended approach for macOS users is via Homebrew, a popular package manager. For Linux and other macOS users, a cURL-based installer script is available. Manual installation is also an option for more controlled environments.

macOS (using Homebrew)

To install the Bitrise CLI on macOS using Homebrew, open your terminal and execute the following commands:

brew update
brew install bitrise

This method ensures that the CLI is kept up-to-date with future brew upgrade commands.

Linux & macOS (using cURL)

For a quick installation on Linux or macOS without Homebrew, you can use the official installer script via cURL:

curl -fL https://install.bitrise.io | bash

This script downloads and installs the latest stable version of the Bitrise CLI to your system. It typically places the executable in /usr/local/bin or a similar directory that is already in your system's PATH.

Manual Installation

For manual installation, you can download the pre-compiled binaries directly from the Bitrise CLI GitHub releases page. Choose the appropriate binary for your operating system and architecture, then place it in a directory included in your system's PATH. For example, on Linux or macOS:

# Download the latest binary (replace with actual version and architecture)
curl -L https://github.com/bitrise-io/bitrise-cli/releases/download/YOUR_VERSION/bitrise-cli-YOUR_OS-YOUR_ARCH -o bitrise

# Make it executable
chmod +x bitrise

# Move to a directory in your PATH
sudo mv bitrise /usr/local/bin/bitrise

# Verify installation
bitrise --version

After installation, verify that the CLI is correctly installed by running bitrise --version. This command should output the installed version of the Bitrise CLI.

Quickstart example

This quickstart example demonstrates how to initialize a Bitrise project locally using the CLI and run a basic workflow. This process is useful for setting up a new project or for testing changes to your bitrise.yml configuration before pushing them to the Bitrise cloud.

Step 1: Initialize a Bitrise project

Navigate to your project's root directory in the terminal. If you don't have a bitrise.yml yet, you can initialize one:

cd /path/to/your/mobile/project
bitrise init

The bitrise init command will guide you through detecting your project type (e.g., iOS, Android, Flutter) and generating a basic bitrise.yml configuration file. It will typically suggest a default workflow based on your project. You can accept the defaults or customize them during the process.

Step 2: Authenticate with Bitrise (optional, for cloud interactions)

If your workflow needs to interact with the Bitrise cloud (e.g., to upload artifacts or trigger cloud builds), you'll need to authenticate. You can set an access token:

bitrise login

This command will prompt you to open a web browser to log into your Bitrise account and generate a personal access token. Once obtained, the CLI will store it securely for future commands.

Step 3: Run a local build

To run a workflow defined in your bitrise.yml locally, use the bitrise run command. By default, it runs the 'primary' workflow, but you can specify any workflow defined in your configuration.

bitrise run primary

This command executes all the Steps defined in the 'primary' workflow on your local machine. This is critical for debugging build issues, testing new Steps, or verifying environment variable configurations without consuming cloud build minutes. The output will show the progress of each step, including logs and any errors.

Step 4: Managing secrets locally

Bitrise workflows often rely on sensitive data like API keys or credentials, stored as secrets. For local builds, you can manage these using the bitrise secrets command:

bitrise secrets add --key MY_API_KEY --value "your_api_key_value"
bitrise secrets scan

The add command allows you to define local secrets that will be available during your local runs. The scan command helps identify potential secrets in your configuration that should be managed securely. This local management ensures that your sensitive information remains protected while still allowing full workflow testing.

Step 5: Inspecting available steps

The Bitrise CLI also allows you to list and inspect the vast library of available Steps directly from your terminal. This is useful when you're building a new workflow or looking for a specific integration.

bitrise setup
bitrise step list
bitrise step info script

bitrise setup ensures your local Step library is up-to-date. bitrise step list displays all available Steps, and bitrise step info [step-id] provides detailed documentation for a specific Step, such as the script Step shown above. This command helps developers understand input/output variables and configurations for each Step.

Community libraries

While Bitrise primarily focuses on its official CLI and extensive Step library for CI/CD automation, the community contributes to the broader mobile development ecosystem that Bitrise integrates with. Many community-developed libraries and tools are not directly Bitrise SDKs but are frequently used within Bitrise workflows. These include:

  • Fastlane: A suite of tools for automating iOS and Android app deployment. Fastlane actions are commonly integrated into Bitrise workflows for tasks like code signing, screenshot generation, and app store submission. The Bitrise platform provides dedicated Steps for interacting with Fastlane tools.
  • Various mobile testing frameworks: Libraries such as XCUITest (iOS), Espresso (Android), Appium, and Detox are used for automated UI and integration testing. Bitrise workflows often incorporate Steps to run tests using these frameworks, with results parsed and displayed in the Bitrise UI.
  • Code quality and analysis tools: Tools like SwiftLint, Ktlint, SonarQube, and RuboCop are used for static code analysis. Community-contributed Bitrise Steps exist to run these tools and report findings, helping enforce code quality standards within CI/CD.
  • Cross-platform development tools: For frameworks like React Native, Flutter, and Xamarin, developers use their respective CLIs and libraries (e.g., react-native-cli, flutter CLI). Bitrise provides specific environment configurations and Steps to support building and testing applications developed with these tools.

These community tools, though not under the direct umbrella of Bitrise SDKs, form an integral part of the mobile development workflows that Bitrise orchestrates. The platform's flexibility allows for easy integration of virtually any command-line tool or script through its generic Script Step, further enabling the use of a wide range of community-developed resources.