# Fastlane

> Automate iOS and Android app releases using Fastlane and the Applivery plugin. Streamline building, testing, and distribution.

Source: https://docs.applivery.com/en/app-distribution/ci-cd/fastlane/  •  Last updated: 2026-04-01

**Key topics:** Fastlane plugin installation, Fastfile configuration, Applivery API token, iOS deployment with Fastlane, Android deployment with Fastlane, Fastlane, Applivery, iOS, Android, App Store, Google Play, Bitrise, Azure Pipelines, GitHub Actions, Jenkins

---

**TL;DR:** Automate your iOS and Android app releases to Applivery using the Fastlane plugin, streamlining the build, upload, and notification process.

![fastlane](https://www.applivery.com/wp-content/uploads/2021/12/fastlane.png "fastlane | Applivery")

[Fastlane](https://fastlane.tools/) is an open-source automation tool for iOS and Android developers that handles building, testing, code signing, and releasing Apps. The [Applivery Fastlane plugin](https://github.com/fastlane-community/fastlane-plugin-applivery) extends Fastlane with an `applivery` action that uploads a built binary to Applivery, attaches CI metadata (commit, branch, tag, repository URL), and optionally sends notifications — all in one step.

---

## Prerequisites

- [Fastlane installed](https://docs.fastlane.tools/#getting-started) on your system or CI agent.
- An Applivery App API Token. Find it in **App Settings → API Tokens** in the Applivery Dashboard, or see [Apps API Token](https://docs.applivery.com/en/app-distribution/api/app-api-token/).
- A `Fastfile` in your project with at least one lane defined.

---

**Install the Plugin**

In your project directory, run:

```bash
fastlane add_plugin applivery
```

This adds the plugin to your `Pluginfile` and installs it. Commit the updated `Pluginfile` and `Gemfile.lock` to your repository so the plugin is automatically available on CI.

**Configure your Fastfile**

Add an `applivery` action to any lane in your `Fastfile`. The only required parameter is `app_token`. All other parameters are optional.

### iOS example

```ruby
platform :ios do
  lane :deploy do
    # Build the app
    gym(
      scheme: "MyApp",
      export_method: "enterprise"   # or "ad-hoc"
    )

    # Upload to Applivery
    applivery(
      app_token: ENV["APPLIVERY_TOKEN"],
      name: "v#{get_version_number} (#{last_git_commit[:abbreviated_commit_hash]})",
      changelog: last_git_commit[:message],
      notify_collaborators: true,
      notify_message: "New build ready for testing",
      tags: "ios, staging"
    )

    puts "Build uploaded. ID: #{lane_context[SharedValues::APPLIVERY_BUILD_ID]}"
  end
end
```

### Android example

```ruby
platform :android do
  lane :deploy do
    # Build the APK
    gradle(task: "assembleRelease")

    # Upload to Applivery
    applivery(
      app_token: ENV["APPLIVERY_TOKEN"],
      name: "v#{android_get_version_name}",
      changelog: last_git_commit[:message],
      notify_collaborators: true,
      notify_message: "New Android build available",
      tags: "android, staging"
    )
  end
end
```
### Running the lane

```bash
fastlane ios deploy
fastlane android deploy
```

## Plugin parameters

| Parameter | Type | Required | Description |
|---|---|---|---|
| `app_token` | String | **Yes** | Your Applivery App API Token. Available in **App Settings → API Tokens**. |
| `name` | String | No | Human-readable build name shown in the Applivery Dashboard. E.g. `RC 1.0`, `v2.4.0-beta`. |
| `changelog` | String | No | Release notes or change description for this Build. |
| `notify_collaborators` | Boolean | No | Send an email notification to app Collaborators after the upload. Default: `false`. |
| `notify_employees` | Boolean | No | Send an email notification to store employees after the upload. Default: `false`. |
| `notify_message` | String | No | Custom message included in the notification email. |
| `tags` | String | No | Comma-separated tags to label the Build. E.g. `"staging, sprint-42"`. |
| `filter` | String | No | Notification group filter. Comma-separated for AND, pipe-separated for OR. E.g. `"group1,group2\|group3"` means (group1 AND group2) OR (group3). |
| `build_path` | String | No | Explicit path to the binary to upload. By default, uses the path produced by `gym()` (iOS) or `gradle()` (Android). |

---

## Shared values

After a successful upload, the plugin exposes the resulting build ID as a Fastlane shared value. You can use it in subsequent lane steps — for example, to trigger further automation, update a Publication, or log the result.

```ruby
applivery(
  app_token: ENV["APPLIVERY_TOKEN"]
)

build_id = lane_context[SharedValues::APPLIVERY_BUILD_ID]
puts "Uploaded build ID: #{build_id}"
```

---

## Storing the Token securely

Never hardcode your App Token directly in the `Fastfile`. Use one of the following approaches depending on your setup:

**Environment variable (recommended for CI):**

```ruby
applivery(
  app_token: ENV["APPLIVERY_TOKEN"]
)
```

Set `APPLIVERY_TOKEN` as a secret environment variable in your CI platform (Bitrise, Azure Pipelines, GitHub Actions, Jenkins, etc.).

**Fastlane `.env` file (recommended for local development):**

Create a `.env` file in your `fastlane/` directory (add it to `.gitignore`):

```
APPLIVERY_TOKEN=your_token_here
```

Fastlane automatically loads `.env` files. Reference the variable the same way: `ENV["APPLIVERY_TOKEN"]`.

---

## Complete Fastfile example

A real-world `Fastfile` with separate iOS and Android deploy lanes, using Git metadata for the changelog and build name:

```ruby
# fastlane/Fastfile

default_platform(:ios)

platform :ios do
  desc "Build and deploy to Applivery"
  lane :deploy do
    increment_build_number(build_number: number_of_commits)

    gym(
      scheme: "MyApp-Staging",
      export_method: "enterprise",
      output_directory: "./build",
      output_name: "MyApp.ipa"
    )

    applivery(
      app_token: ENV["APPLIVERY_TOKEN"],
      name: "#{get_version_number} (#{last_git_commit[:abbreviated_commit_hash]})",
      changelog: last_git_commit[:message],
      notify_collaborators: true,
      notify_message: "New iOS build — #{git_branch}",
      tags: "ios, #{git_branch}"
    )

    puts "✅ Uploaded to Applivery. Build ID: #{lane_context[SharedValues::APPLIVERY_BUILD_ID]}"
  end
end

platform :android do
  desc "Build and deploy to Applivery"
  lane :deploy do
    gradle(
      task: "assemble",
      build_type: "Release"
    )

    applivery(
      app_token: ENV["APPLIVERY_TOKEN"],
      name: "#{android_get_version_name} (#{last_git_commit[:abbreviated_commit_hash]})",
      changelog: last_git_commit[:message],
      notify_collaborators: true,
      notify_message: "New Android build — #{git_branch}",
      tags: "android, #{git_branch}"
    )

    puts "✅ Uploaded to Applivery. Build ID: #{lane_context[SharedValues::APPLIVERY_BUILD_ID]}"
  end
end
```
